use of org.syncany.plugins.transfer.FileType in project syncany by syncany.
the class PathAwareFeatureTransferManager method list.
private <T extends RemoteFile> void list(String remoteFilePath, Map<String, T> remoteFiles, Class<T> remoteFileClass) throws StorageException {
logger.log(Level.INFO, "Listing folder for files matching " + remoteFileClass.getSimpleName() + ": " + remoteFilePath);
Map<String, FileType> folderList = pathAwareFeatureExtension.listFolder(remoteFilePath);
for (Map.Entry<String, FileType> folderListEntry : folderList.entrySet()) {
String fileName = folderListEntry.getKey();
FileType fileType = folderListEntry.getValue();
if (fileType == FileType.FILE) {
try {
remoteFiles.put(fileName, RemoteFile.createRemoteFile(fileName, remoteFileClass));
logger.log(Level.INFO, "- File: " + fileName);
} catch (StorageException e) {
// We don't care and ignore non-matching files!
}
} else if (fileType == FileType.FOLDER) {
logger.log(Level.INFO, "- Folder: " + fileName);
String newRemoteFilePath = remoteFilePath + folderSeparator + fileName;
list(newRemoteFilePath, remoteFiles, remoteFileClass);
}
}
}
Aggregations