-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f9f753a
commit 069cb8b
Showing
17 changed files
with
188 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { NotifyFuseCallback } from './FuseCallback'; | ||
|
||
export class ChownCallback extends NotifyFuseCallback { | ||
constructor() { | ||
super('Chown', { input: true, output: true }); | ||
} | ||
|
||
async execute(path: string, uid: number, gid: number) { | ||
return this.right(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,38 @@ | ||
import { OfflineDriveDependencyContainer } from '../dependency-injection/offline/OfflineDriveDependencyContainer'; | ||
import { VirtualDriveDependencyContainer } from '../dependency-injection/virtual-drive/VirtualDriveDependencyContainer'; | ||
import { FuseCallback } from './FuseCallback'; | ||
|
||
export class ReaddirCallback extends FuseCallback<Array<string>> { | ||
constructor(private readonly container: VirtualDriveDependencyContainer) { | ||
constructor( | ||
private readonly virtual: VirtualDriveDependencyContainer, | ||
private readonly offline: OfflineDriveDependencyContainer | ||
) { | ||
super('Read Directory'); | ||
} | ||
|
||
async execute(path: string) { | ||
const filesNamesPromise = | ||
this.container.filesByFolderPathNameLister.run(path); | ||
this.virtual.filesByFolderPathNameLister.run(path); | ||
|
||
const folderNamesPromise = | ||
this.container.foldersByParentPathLister.run(path); | ||
const folderNamesPromise = this.virtual.foldersByParentPathLister.run(path); | ||
|
||
const offlineFiles = await this.offline.offlineFilesByParentPathLister.run( | ||
path | ||
); | ||
|
||
const offlineFilesNames = offlineFiles.map((file) => file.name); | ||
|
||
const [filesNames, foldersNames] = await Promise.all([ | ||
filesNamesPromise, | ||
folderNamesPromise, | ||
]); | ||
|
||
return this.right(['.', '..', ...filesNames, ...foldersNames]); | ||
return this.right([ | ||
'.', | ||
'..', | ||
...filesNames, | ||
...foldersNames, | ||
...offlineFilesNames, | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/context/offline-drive/files/application/OfflineFileListerByParentFolder.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { dirname } from 'path'; | ||
import { OfflineFile } from '../domain/OfflineFile'; | ||
import { OfflineFileRepository } from '../domain/OfflineFileRepository'; | ||
|
||
export class OfflineFilesByParentPathLister { | ||
constructor(private readonly repository: OfflineFileRepository) {} | ||
|
||
async run(path: string): Promise<Array<OfflineFile>> { | ||
const parentPath = dirname(path); | ||
|
||
const all = await this.repository.all(); | ||
|
||
return all.filter((file) => file.path.dirname() === parentPath); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.