当前位置: 首页>>代码示例>>Java>>正文


Java StorageApi.GetDownload方法代码示例

本文整理汇总了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
}
 
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:27,代码来源:SetModifyPassword.java

示例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
}
 
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:27,代码来源:SetModifyPassword.java

示例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
}
 
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:28,代码来源:RemoveAllProperties.java

示例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

}
 
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:39,代码来源:ClearCellFormattingWorksheet.java

示例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
}
 
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:35,代码来源:UnmergeCellsWorksheet.java

示例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

}
 
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:31,代码来源:DeleteAllCharts.java

示例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

}
 
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:28,代码来源:RemoveParticularProperty.java

示例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

}
 
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:31,代码来源:HideChartLegend.java

示例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

}
 
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:40,代码来源:CopyRowsInWorksheet.java

示例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

}
 
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:32,代码来源:SetWatermarkBackground.java

示例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

}
 
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:30,代码来源:UnprotectWorkbook.java

示例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

}
 
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:31,代码来源:RenameWorksheet.java

示例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

}
 
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:31,代码来源:CopyWorksheet.java

示例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

}
 
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:30,代码来源:DeleteWorksheet.java

示例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

}
 
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:34,代码来源:HideWorksheet.java


注:本文中的com.aspose.storage.api.StorageApi.GetDownload方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。