@Autowired private StorageClient storageClient;
String path = ClassLoader.getSystemResource("123456.txt").getPath(); File file = new File(path); FileInputStream fileInputStream = FileUtils.openInputStream(file);
StorePath storePath = storageClient.uploadFile("group1", fileInputStream, file.length(), "txt");
StorePath storePath = storageClient.uploadFile(fileInputStream, file.length(), "txt");
StorePath storePath = storageClient.uploadFile(path);
StorePath storePath = storageClient.uploadFile(path, "txt");
StorePath storePath = storageClient.uploadFile("group1", path, "txt");
StorePath storePath = storageClient.uploadFile(fileInputStream, file.length(), "txt", metaDataSet);
Set<MateData> metaDataSet = new HashSet<MateData>(); MateData mateData = new MateData("mateDataName","mateDataValue"); metaDataSet.add(mateData); StorePath storePath = storageClient.uploadFile("group1", fileInputStream, file.length(), "txt", metaDataSet);
String masterFileId = storePath.getFullPath(); String[] parts = new String[2]; splitFileId(masterFileId, parts); storePath = storageClient.uploadSlaveFile(parts[0], parts[1], fileInputStream, file.length(), "-1", "txt");
storePath = storageClient.uploadSlaveFile(masterFileId, fileInputStream, file.length(), "-1", "xlsx"); fileInputStream.close();
String path = ClassLoader.getSystemResource("123456.txt").getPath(); StorePath storePath = storageClient.uploadFile("group1", path, "txt"); addResultFileId(storePath.getFullPath()); DownloadFileWriter downloadFileWriter = new DownloadFileWriter(path.replaceAll("123456.txt", "123456downlaod1.txt")); String filePath = storageClient.downloadFile(storePath.getGroup(), storePath.getPath(), downloadFileWriter);
DownloadFileWriter downloadFileWriter = new DownloadFileWriter(path.replaceAll("123456.txt", "123456downlaod2.txt")); String filePath = storageClient.downloadFile(storePath.getFullPath(), downloadFileWriter);
DownloadFileWriter downloadFileWriter = new DownloadFileWriter(path.replaceAll("123456.txt", "123456downlaod3.txt")); String filePath = storageClient.downloadFile(storePath.getGroup(), storePath.getPath(), 10, 0, downloadFileWriter);
DownloadFileWriter downloadFileWriter = new DownloadFileWriter(path.replaceAll("123456.txt", "123456downlaod4.txt")); String filePath = storageClient.downloadFile(storePath.getFullPath(), 5, 0, downloadFileWriter);
String path = ClassLoader.getSystemResource("123456.txt").getPath(); StorePath storePath = storageClient.uploadFile("group1", path, "txt"); boolean flag = storageClient.deleteFile(storePath.getGroup(), storePath.getPath());
boolean flag = storageClient.deleteFile(storePath.getFullPath());
String path = ClassLoader.getSystemResource("123456.txt").getPath(); StorePath storePath = storageClient.uploadFile("group1", path, "txt"); addResultFileId(storePath.getFullPath()); String fileId = storePath.getFullPath(); FileInfo fileInfo = storageClient.getFileInfo(storePath.getGroup(), storePath.getPath());
FileInfo fileInfo = storageClient.getFileInfo(fileId);
String masterFileId = storePath.getFullPath(); String[] parts = new String[2]; splitFileId(masterFileId, parts); Set<MateData> mateDataSet = storageClient.getMetadata(parts[0], parts[1]);
Set<MateData> mateDataSet = storageClient.getMetadata(masterFileId);
String[] parts = new String[2]; splitFileId(masterFileId, parts); mateDataSet = new HashSet<MateData>(); mateDataSet.add(new MateData("key5", "value5")); mateDataSet.add(new MateData("key6", "value6")); mateDataSet.add(new MateData("key7", "value7")); boolean flag = storageClient.overwriteMetadata(parts[0], parts[1], mateDataSet);
boolean flag = storageClient.overwriteMetadata(masterFileId, mateDataSet);
String[] parts = new String[2]; splitFileId(masterFileId, parts); mateDataSet = new HashSet<MateData>(); mateDataSet.add(new MateData("key5", "value5")); mateDataSet.add(new MateData("key6", "value6")); mateDataSet.add(new MateData("key7", "value7")); boolean flag = storageClient.mergeMetadata(parts[0], parts[1], mateDataSet);
boolean flag = storageClient.mergeMetadata(masterFileId, mateDataSet);
appendFile
modifyFile
truncateFile
|