-
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.
Change: Progressive file retrieval implemented
- Loading branch information
1 parent
9752c7d
commit 1407b7a
Showing
8 changed files
with
553 additions
and
45 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
32 changes: 32 additions & 0 deletions
32
src/context/virtual-drive/items/application/TreeProgresiveBuilder.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,32 @@ | ||
import { ServerFileStatus } from '../../../shared/domain/ServerFile'; | ||
import { ServerFolderStatus } from '../../../shared/domain/ServerFolder'; | ||
import { Tree } from '../domain/Tree'; | ||
import { RemoteItemsGenerator } from './RemoteItemsGenerator'; | ||
import { Traverser } from './Traverser'; | ||
|
||
export class TreeProgresiveBuilder { | ||
constructor( | ||
private readonly remoteItemsGenerator: RemoteItemsGenerator, | ||
private readonly traverser: Traverser | ||
) {} | ||
|
||
public setFilterStatusesToFilter(statuses: Array<ServerFileStatus>): void { | ||
this.traverser.setFileStatusesToFilter(statuses); | ||
} | ||
|
||
public setFolderStatusesToFilter(statuses: Array<ServerFolderStatus>): void { | ||
this.traverser.setFolderStatusesToFilter(statuses); | ||
} | ||
// hacer un recorrido progresivo empezar por el root y luego ir a los folders hijos y ejecutar el traverser | ||
|
||
async run(): Promise<Tree> { | ||
// obtener los items del root | ||
|
||
// ejecutar el traverser | ||
|
||
// ejecutar el recursiveTraverse para cada folder hijo | ||
const items = await this.remoteItemsGenerator.getAll(); | ||
|
||
return this.traverser.run(items); | ||
} | ||
} |