@@ -243,10 +243,35 @@ export class Drive implements Contents.IDrive {
243243 }
244244 }
245245
246- data = await getContents ( currentDrive . name , {
247- path : formatPath ( localPath ) ,
246+ const currentPath = formatPath ( localPath ) ;
247+ const result = await getContents ( currentDrive . name , {
248+ path : currentPath ,
248249 registeredFileTypes : this . _registeredFileTypes
249250 } ) ;
251+
252+ data = {
253+ name : result . isDir
254+ ? currentPath
255+ ? PathExt . basename ( currentPath )
256+ : currentDrive . name
257+ : PathExt . basename ( currentPath ) ,
258+ path : PathExt . join (
259+ currentDrive . name ,
260+ result . isDir
261+ ? currentPath
262+ ? currentPath + '/'
263+ : ''
264+ : result . response . data . path
265+ ) ,
266+ last_modified : result . isDir ? '' : result . response . data . last_modified ,
267+ created : '' ,
268+ content : result . isDir ? result . files : result . response . data . content ,
269+ format : result . isDir ? 'json' : result . format ! ,
270+ mimetype : result . isDir ? '' : result . mimetype ! ,
271+ size : result . isDir ? undefined : result . response . data . size ,
272+ writable : true ,
273+ type : result . isDir ? 'directory' : result . type !
274+ } ;
250275 } else {
251276 // retriving list of contents from root
252277 // in our case: list available drives
@@ -314,11 +339,27 @@ export class Drive implements Contents.IDrive {
314339 path . indexOf ( '/' ) !== - 1 ? path . substring ( path . indexOf ( '/' ) + 1 ) : '' ;
315340
316341 // get current list of contents of drive
317- const old_data = await getContents ( currentDrive . name , {
342+ const result = await getContents ( currentDrive . name , {
318343 path : relativePath ,
319344 registeredFileTypes : this . _registeredFileTypes
320345 } ) ;
321346
347+ const old_data : Contents . IModel = {
348+ name : relativePath ? PathExt . basename ( relativePath ) : currentDrive . name ,
349+ path : PathExt . join (
350+ currentDrive . name ,
351+ relativePath ? relativePath + '/' : ''
352+ ) ,
353+ last_modified : '' ,
354+ created : '' ,
355+ content : result . files ,
356+ format : 'json' ! ,
357+ mimetype : '' ,
358+ size : undefined ,
359+ writable : true ,
360+ type : 'directory'
361+ } ;
362+
322363 if ( options . type !== undefined ) {
323364 // get incremented untitled name
324365 const name = this . incrementUntitledName ( old_data , options ) ;
0 commit comments