本文整理汇总了Java中com.aspose.storage.api.StorageApi.GetDownload方法的典型用法代码示例。如果您正苦于以下问题:Java StorageApi.GetDownload方法的具体用法?Java StorageApi.GetDownload怎么用?Java StorageApi.GetDownload使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.aspose.storage.api.StorageApi
的用法示例。
在下文中一共展示了StorageApi.GetDownload方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void main(String... args) throws IOException {
// ExStart: set-modify-password
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
String input = "Sample1.xlsx";
String output = "Sample2.xlsx";
Path inputFile = Utils.getPath(SetModifyPassword.class, input);
Path outputFile = Utils.getPath(SetModifyPassword.class, output);
com.aspose.cells.model.PasswordRequest properties = new com.aspose.cells.model.PasswordRequest();
properties.setPassword("aspose");
storageApi.PutCreate(input, null, Utils.STORAGE, inputFile.toFile());
cellsApi.PutDocumentProtectFromChanges(input, null, null, properties);
com.aspose.storage.model.ResponseMessage sr = storageApi.GetDownload(input, null, Utils.STORAGE);
Files.copy(sr.getInputStream(), outputFile, StandardCopyOption.REPLACE_EXISTING);
} catch (Exception e) {
e.printStackTrace();
}
// ExEnd: set-modify-password
}
示例2: execute
import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void execute(Context context) throws IOException {
//ExStart: set-modify-password
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
String input = "Sample1.xlsx";
String output = "Sample2.xlsx";
File inputFile = Utils.stream2file("sample1","xlsx", context.getResources().openRawResource(R.raw.sample1));
File outputFile = Utils.stream2file("sample2","xlsx", context.getResources().openRawResource(R.raw.sample2));
com.aspose.cells.model.PasswordRequest properties = new com.aspose.cells.model.PasswordRequest();
properties.setPassword("aspose");
storageApi.PutCreate(input, null, Utils.STORAGE, inputFile);
cellsApi.PutDocumentProtectFromChanges(input, null, null, properties);
com.aspose.storage.model.ResponseMessage sr = storageApi.GetDownload(input, null, Utils.STORAGE);
Utils.copyInputStreamToFile(sr.getInputStream(),outputFile);
} catch (Exception e) {
e.printStackTrace();
}
//ExEnd: set-modify-password
}
示例3: main
import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void main(String... args) throws IOException {
// ExStart: remove-all-properties
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
String input = "sample1.xlsx";
Path inputFile = Utils.getPath(RemoveAllProperties.class, input);
String output = "sample2.xlsx";
Path outputFile = Utils.getPath(RemoveAllProperties.class, output);
storageApi.PutCreate(input, Utils.STORAGE, null, inputFile.toFile());
cellsApi.DeleteDocumentProperties(input, Utils.STORAGE, null);
com.aspose.storage.model.ResponseMessage sr = storageApi.GetDownload(input, null, Utils.STORAGE);
Files.copy(sr.getInputStream(), outputFile, StandardCopyOption.REPLACE_EXISTING);
}
catch (Exception e) {
e.printStackTrace();
}
// ExEnd: remove-all-properties
}
示例4: execute
import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void execute(Context context) throws IOException {
//ExStart: clear-cells-formatting
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
String input = "sample1.xlsx";
String output = "sample2.xlsx";
File inputFile = Utils.stream2file("sample1","xlsx", context.getResources().openRawResource(R.raw.sample1));
File outputFile = Utils.stream2file("sample2","xlsx", context.getResources().openRawResource(R.raw.sample2));
String sheetName = "Sheet1";
String range = "A1:A12";
Integer startRow = null;
Integer startColumn = null;
Integer endRow = null;
Integer endColumn = null;
storageApi.PutCreate(input, null, Utils.STORAGE, inputFile);
cellsApi.PostClearFormats(input, sheetName, range, startRow, startColumn, endRow, endColumn, Utils.STORAGE,
Utils.FOLDER);
com.aspose.storage.model.ResponseMessage sr = storageApi.GetDownload(input, null, Utils.STORAGE);
Utils.copyInputStreamToFile(sr.getInputStream(),outputFile);
}
catch (Exception e) {
e.printStackTrace();
}
//ExEnd: clear-cells-formatting
}
示例5: execute
import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void execute(Context context) throws IOException {
//ExStart: unmerge-cells-in-worksheet
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
String input = "sample1.xlsx";
Path inputFile = Utils.getPath(UnmergeCellsWorksheet.class, input);
String output = "sample2.xlsx";
Path outputFile = Utils.getPath(UnmergeCellsWorksheet.class, output);
String sheetName = "Sheet1";
Integer startRow = 1;
Integer startColumn = 0;
Integer totalRows = 1;
Integer totalColumns = 5;
storageApi.PutCreate(input, null, Utils.STORAGE, inputFile.toFile());
cellsApi.PostWorksheetUnmerge(input, sheetName, startRow, startColumn, totalRows, totalColumns,
Utils.STORAGE, Utils.FOLDER);
com.aspose.storage.model.ResponseMessage sr = storageApi.GetDownload(input, null, Utils.STORAGE);
Files.copy(sr.getInputStream(), outputFile, StandardCopyOption.REPLACE_EXISTING);
}
catch (Exception e) {
e.printStackTrace();
}
//ExEnd: unmerge-cells-in-worksheet
}
示例6: main
import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void main(String... args) throws IOException {
// ExStart: delete-all-charts
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
String input = "Sample1.xlsx";
String output = "Sample2.xlsx";
Path inputFile = Utils.getPath(DeleteAllCharts.class, input);
Path outputFile = Utils.getPath(DeleteAllCharts.class, output);
String sheet = "Sheet1";
storageApi.PutCreate(input, null, Utils.STORAGE, inputFile.toFile());
cellsApi.DeleteWorksheetClearCharts(input, sheet, Utils.STORAGE, Utils.FOLDER);
com.aspose.storage.model.ResponseMessage sr = storageApi.GetDownload(input, null, Utils.STORAGE);
Files.copy(sr.getInputStream(), outputFile, StandardCopyOption.REPLACE_EXISTING);
}
catch (Exception e) {
e.printStackTrace();
}
// ExEnd: delete-all-charts
}
示例7: execute
import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void execute(Context context) throws IOException {
//ExStart: remove-particular-property
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
String input = "sample7.xlsx";
String output = "sample2.xlsx";
File inputFile = Utils.stream2file("sample7","xlsx", context.getResources().openRawResource(R.raw.sample7));
File outputFile = Utils.stream2file("sample2","xlsx", context.getResources().openRawResource(R.raw.sample2));
String propertyName = "Author";
storageApi.PutCreate(input, Utils.STORAGE, null, inputFile);
cellsApi.DeleteDocumentProperty(input, propertyName, Utils.STORAGE, null);
com.aspose.storage.model.ResponseMessage sr = storageApi.GetDownload(input, null, Utils.STORAGE);
Utils.copyInputStreamToFile(sr.getInputStream(),outputFile); }
catch (Exception e) {
e.printStackTrace();
}
//ExEnd: remove-particular-property
}
示例8: main
import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void main(String... args) throws IOException {
// ExStart: hide-chart-legend
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
String input = "Sample1.xlsx";
String output = "Sample2.xlsx";
Path inputFile = Utils.getPath(HideChartLegend.class, input);
Path outputFile = Utils.getPath(HideChartLegend.class, output);
String sheet = "Sheet1";
Integer chartIndex = 0;
storageApi.PutCreate(input, null, Utils.STORAGE, inputFile.toFile());
cellsApi.DeleteWorksheetChartLegend(input, sheet, chartIndex, Utils.STORAGE, Utils.FOLDER);
com.aspose.storage.model.ResponseMessage sr = storageApi.GetDownload(input, null, Utils.STORAGE);
Files.copy(sr.getInputStream(), outputFile, StandardCopyOption.REPLACE_EXISTING);
}
catch (Exception e) {
e.printStackTrace();
}
// ExEnd: hide-chart-legend
}
示例9: execute
import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void execute(Context context) throws IOException {
//ExStart: copy-rows-in-worksheet
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
String input = "sample1.xlsx";
String output = "sample2.xlsx";
File inputFile = Utils.stream2file("sample1","xlsx", context.getResources().openRawResource(R.raw.sample1));
File outputFile = Utils.stream2file("sample2","xlsx", context.getResources().openRawResource(R.raw.sample2));
String sheetName = "Sheet1";
Integer sourceRowIndex = 1;
Integer destinationRowIndex = 2;
Integer rowNumber = 10;
String worksheet = "Sheet1";
storageApi.PutCreate(input, null, Utils.STORAGE, inputFile);
cellsApi.PostCopyWorksheetRows(input, sheetName, sourceRowIndex, destinationRowIndex, rowNumber, worksheet,
Utils.STORAGE, Utils.FOLDER);
com.aspose.storage.model.ResponseMessage sr = storageApi.GetDownload(input, null, Utils.STORAGE);
Utils.copyInputStreamToFile(sr.getInputStream(),outputFile);
}
catch (Exception e) {
e.printStackTrace();
}
//ExEnd: copy-rows-in-worksheet
}
示例10: main
import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void main(String... args) throws IOException {
// ExStart: set-watermark-background
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
Path inputFile = Utils.getPath(SetWatermarkBackground.class, "Sample1.xlsx");
Path outputFile = Utils.getPath(SetWatermarkBackground.class, "Sample2.xlsx");
Path imageFile = Utils.getPath(SetWatermarkBackground.class, "aspose.png");
storageApi.PutCreate(inputFile.getFileName().toString(), null, Utils.STORAGE, inputFile.toFile());
String sheetName = "Sheet1";
cellsApi.PutWorkSheetBackground(inputFile.getFileName().toString(), sheetName, Utils.FOLDER, Utils.STORAGE,
imageFile.toFile());
com.aspose.storage.model.ResponseMessage sr = storageApi.GetDownload(inputFile.getFileName().toString(),
null, Utils.STORAGE);
Files.copy(sr.getInputStream(), outputFile, StandardCopyOption.REPLACE_EXISTING);
}
catch (Exception e) {
e.printStackTrace();
}
// ExEnd: set-watermark-background
}
示例11: execute
import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void execute(Context context) throws IOException {
//ExStart: unprotect-excel-workbook
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
String input = "Sample1.xlsx";
String output = "Sample2.xlsx";
File inputFile = Utils.stream2file("sample1","xlsx", context.getResources().openRawResource(R.raw.sample1));
File outputFile = Utils.stream2file("sample2","xlsx", context.getResources().openRawResource(R.raw.sample2));
com.aspose.cells.model.WorkbookProtectionRequest properties = new com.aspose.cells.model.WorkbookProtectionRequest();
properties.setPassword("12345678");
properties.setProtectionType("None");
storageApi.PutCreate(input, null, Utils.STORAGE, inputFile);
cellsApi.DeleteUnProtectDocument(input, Utils.STORAGE, null, properties);
com.aspose.storage.model.ResponseMessage sr = storageApi.GetDownload(input, null, Utils.STORAGE);
Utils.copyInputStreamToFile(sr.getInputStream(),outputFile);
} catch (Exception e) {
e.printStackTrace();
}
//ExEnd: unprotect-excel-workbook
}
示例12: main
import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void main(String... args) throws IOException {
// ExStart: rename-excel-worksheeet
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
String input = "Sample1.xlsx";
String output = "Sample2.xlsx";
Path inputFile = Utils.getPath(RenameWorksheet.class, input);
Path outputFile = Utils.getPath(RenameWorksheet.class, output);
String oldName = "Sheet1";
String newName = "Sheet2";
storageApi.PutCreate(input, null, Utils.STORAGE, inputFile.toFile());
cellsApi.PostRenameWorksheet(input, oldName, newName, null, Utils.STORAGE);
com.aspose.storage.model.ResponseMessage sr = storageApi.GetDownload(input, null, Utils.STORAGE);
Files.copy(sr.getInputStream(), outputFile, StandardCopyOption.REPLACE_EXISTING);
}
catch (Exception e) {
e.printStackTrace();
}
// ExEnd: rename-excel-worksheeet
}
示例13: execute
import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void execute(Context context) throws IOException {
//ExStart: copy-excel-worksheet
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
String input = "Sample1.xlsx";
String output = "Sample2.xlsx";
File inputFile = Utils.stream2file("sample1","xlsx", context.getResources().openRawResource(R.raw.sample1));
File outputFile = Utils.stream2file("sample2","xlsx", context.getResources().openRawResource(R.raw.sample2));
String sourceSheet = "Sheet1";
String copySheet = "Sheet2";
storageApi.PutCreate(input, null, Utils.STORAGE, inputFile);
cellsApi.PostCopyWorksheet(input, copySheet, sourceSheet, null, Utils.STORAGE);
com.aspose.storage.model.ResponseMessage sr = storageApi.GetDownload(input, null, Utils.STORAGE);
Utils.copyInputStreamToFile(sr.getInputStream(),outputFile);
}
catch (Exception e) {
e.printStackTrace();
}
//ExEnd: copy-excel-worksheet
}
示例14: main
import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void main(String... args) throws IOException {
// ExStart: remove-worksheets
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
String input = "Sample1.xlsx";
String output = "Sample2.xlsx";
Path inputFile = Utils.getPath(DeleteWorksheet.class, input);
Path outputFile = Utils.getPath(DeleteWorksheet.class, output);
String sheet = "Sheet1";
storageApi.PutCreate(input, null, Utils.STORAGE, inputFile.toFile());
com.aspose.cells.model.WorksheetsResponse wr = cellsApi.DeleteWorksheet(input, sheet, Utils.STORAGE, null);
com.aspose.storage.model.ResponseMessage sr = storageApi.GetDownload(input, null, Utils.STORAGE);
Files.copy(sr.getInputStream(), outputFile, StandardCopyOption.REPLACE_EXISTING);
}
catch (Exception e) {
e.printStackTrace();
}
// ExEnd: remove-worksheets
}
示例15: main
import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void main(String... args) throws IOException {
// ExStart: hide-worksheets
try {
// Instantiate Aspose Storage API SDK
StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
// Instantiate Aspose Words API SDK
CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
String input = "Sample1.xlsx";
String output = "Sample2.xlsx";
Path inputFile = Utils.getPath(HideWorksheet.class, input);
Path outputFile = Utils.getPath(HideWorksheet.class, output);
String sheet = "Sheet1";
boolean isVisible = false;
storageApi.PutCreate(input, null, Utils.STORAGE, inputFile.toFile());
com.aspose.cells.model.WorksheetResponse wr = cellsApi.PutChangeVisibilityWorksheet(input, sheet, isVisible,
Utils.STORAGE, null);
System.out.println("Visibility Type: " + wr.getWorksheet().getVisibilityType());
com.aspose.storage.model.ResponseMessage sr = storageApi.GetDownload(input, null, Utils.STORAGE);
Files.copy(sr.getInputStream(), outputFile, StandardCopyOption.REPLACE_EXISTING);
}
catch (Exception e) {
e.printStackTrace();
}
// ExEnd: hide-worksheets
}