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


Java StorageApi.PutCreate方法代码示例

本文整理汇总了Java中com.aspose.storage.api.StorageApi.PutCreate方法的典型用法代码示例。如果您正苦于以下问题:Java StorageApi.PutCreate方法的具体用法?Java StorageApi.PutCreate怎么用?Java StorageApi.PutCreate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.aspose.storage.api.StorageApi的用法示例。


在下文中一共展示了StorageApi.PutCreate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUpClass

import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
@BeforeClass
public static void setUpClass() {
	try {
		wordsApi = new WordsApi("http://api.aspose.cloud/v1.1", apiKey, appSID);
		storageApi = new StorageApi("http://api.aspose.cloud/v1.1", apiKey, appSID);
		
		Path path=getPath(WordsApi.class,"test_multi_pages.docx");
		storageApi.PutCreate("SampleWordDocument.docx", "", "",path.toFile());
		storageApi.PutCreate("test_multi_pages.docx", "", "",path.toFile());
		path=getPath(WordsApi.class,"test_convertlocal.docx");
		storageApi.PutCreate("test_convertlocal.docx", "", "",path.toFile());
		path=getPath(WordsApi.class,"test_doc.docx");
		storageApi.PutCreate("test_doc.docx", "", "",path.toFile());
		path=getPath(WordsApi.class,"test_uploadfile.docx");
		storageApi.PutCreate("test_uploadfile.docx", "", "",path.toFile());
		path=getPath(WordsApi.class,"test_multi_pages.docx");
		storageApi.PutCreate("test_multi_pages.docx", "", "",path.toFile());
		path=getPath(WordsApi.class,"SampleMailMergeTemplate.docx");
		storageApi.PutCreate("SampleMailMergeTemplate.docx", "", "",path.toFile());

	} catch (Exception e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}
 
开发者ID:aspose-words,项目名称:Aspose.Words-for-Cloud,代码行数:26,代码来源:WordsApiTest.java

示例2: execute

import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void execute(Context context) throws IOException {
// ExStart: convert-workbook-to-different-format
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);

			File inputFile = Utils.stream2file("sample1","xlsx", context.getResources().openRawResource(R.raw.sample1));
			File outputFile = Utils.stream2file("sample2","xlsx", context.getResources().openRawResource(R.raw.sample2));

			storageApi.PutCreate("sample1.xlsx", null, Utils.STORAGE, inputFile);

			ResponseMessage cr = cellsApi.GetWorkBookWithFormat("sample1.xlsx", "pdf", null, true,
					Utils.STORAGE, Utils.FOLDER, null);
			Utils.copyInputStreamToFile(cr.getInputStream(),outputFile);
		}

		catch (Exception e) {
			e.printStackTrace();
		}
// ExEnd: convert-workbook-to-different-format
	}
 
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:25,代码来源:ConvertWorkbookToAnotherFormat.java

示例3: execute

import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void execute(Context context) throws Exception{
	// ExStart: 1
	try {
		// Instantiate Aspose Storage API SDK
		StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);

		// Instantiate Aspose Words API SDK
		WordsApi wordsApi = new WordsApi(Configuration.apiKey, Configuration.appSID, true);

		// set input file name
		String fileName = "TableDocument.doc";
		String storage = null;
		String folder = null;

		File input = Utils.stream2file("TableDocument","docx", context.getResources().openRawResource(R.raw.tabledocument));

		// upload input file to aspose cloud storage
		storageApi.PutCreate(fileName, "", "",input);

		//Invoke the API
		TableLinkCollectionResponse apiResponse = wordsApi.GetTables("TableDocument.doc", "tables/1/rows/0/borders", storage, folder);

		if (apiResponse != null && apiResponse.getStatus().equals("OK")) {

			System.out.println("Reading Table Information Done");
		}
           
	} catch (Exception e) {
		e.printStackTrace();
	}
	// ExEnd: 1

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

示例4: main

import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void main(String[] argv){
	//ExStart: DeleteTaskFromProjectExample
	String name = "sample-project.mpp";
	int taskUid = 1;
	String storage = "";
	String folder = "";
	String fileName = "";
	Path inputFile = Utils.getPath(RetrieveTaskInformationExample.class, name);

	try
	{
		StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
		// Instantiate Aspose Words API SDK
		TasksApi tasksApi = new TasksApi(Configuration.apiKey, Configuration.appSID, true);
	    // Upload source file to aspose cloud storage
	    storageApi.PutCreate(name, "", "", inputFile.toFile());

	    // Invoke Aspose.Tasks Cloud SDK API to delete task information
	    SaaSposeResponse apiResponse = tasksApi.DeleteProjectTask(name, taskUid, storage, folder, fileName);

	    if (apiResponse != null && apiResponse.getStatus().equals("OK"))
	    {
	    	System.out.println("Delete a Task from Project, Done!");
	    }
	}
	catch (Exception ex)
	{
	    ex.printStackTrace();
	}
	//ExEnd: DeleteTaskFromProjectExample
}
 
开发者ID:aspose-tasks,项目名称:Aspose.Tasks-for-Cloud,代码行数:32,代码来源:DeleteTaskFromProjectExample.java

示例5: main

import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void main(String[] args) {
	// ExStart: 1
	try {
		// Instantiate Aspose Storage API SDK
		StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);

		// Instantiate Aspose Words API SDK
		WordsApi wordsApi = new WordsApi(Configuration.apiKey, Configuration.appSID, true);

		// set input file name
		String fileName = "MathsObject.docx";
		String storage = null;
		String folder = null;
		
		Path path=Utils.getPath(ReadOfficeMathObjectsByIndexExample.class, fileName);

		// upload input file to aspose cloud storage
		storageApi.PutCreate(fileName, "", "",path.toFile());

		//Invoke the API
		OfficeMathObjectsResponse apiResponse = wordsApi.GetOfficeMathObjects("MathsObject.docx",0,0,0, storage, folder);

		if (apiResponse != null && apiResponse.getStatus().equals("OK")) {

			System.out.println("Reading Math Objects by Index Done");
		}
           
	} catch (Exception e) {
		e.printStackTrace();
	}
	// ExEnd: 1

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

示例6: main

import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void main(String[] args) {

		//ExStart: 1
		String fileName = "Book1.xlsx";
		String sheetName = "Sheet1";
		String storage = null;
		String folder = null;

		try
		{
			StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
            // Instantiate Aspose Words API SDK
            CellsApi cellsApi = new CellsApi(Configuration.apiKey, Configuration.appSID, true);
		    // Upload source file to aspose cloud storage
            Path inputFile = Utils.getPath(DeleteFilterForFilterColumnExample.class, "Sample.xlsx");
            storageApi.PutCreate(fileName, "", "", inputFile.toFile());
            
		    // Invoke Aspose.Cells Cloud SDK API to get worksheet autofilter
            SaaSposeResponse apiResponse = cellsApi.DeleteWorksheetDateFilter(fileName, sheetName, "fieldIndex=0&dateTimeGroupingType=Year&year=1920", storage, folder);

		    if (apiResponse != null && apiResponse.getStatus().equals("Ok"))
		    {
		        System.out.println("Get worksheet autofilter, Done!");
		    }
		}
		catch (Exception ex)
		{
		   ex.printStackTrace();
		}
		//ExEnd: 1

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

示例7: execute

import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void execute(Context context) throws IOException {
	//ExStart: change-cell-style-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);
		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 cellName = "A2";

		com.aspose.cells.model.Style body = new com.aspose.cells.model.Style();
		com.aspose.cells.model.Font font = new com.aspose.cells.model.Font();
		font.setName("Calibri");
		font.setSize(40);
		body.setFont(font);

		storageApi.PutCreate("sample1.xlsx", null, Utils.STORAGE, inputFile);

		cellsApi.PostUpdateWorksheetCellStyle("sample1.xlsx", sheetName, cellName, Utils.STORAGE, Utils.FOLDER,
				body);

		com.aspose.storage.model.ResponseMessage sr = storageApi.GetDownload("sample1.xlsx", null, Utils.STORAGE);

		Utils.copyInputStreamToFile(sr.getInputStream(),outputFile);
	}

	catch (Exception e) {
		e.printStackTrace();
	}
	//ExEnd: change-cell-style-in-worksheet
}
 
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-Cloud,代码行数:36,代码来源:ChangeCellStyleWorksheet.java

示例8: execute

import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void execute(Context context) throws Exception {
	// ExStart: GetProtectionWordDocumentExample

	try {
		// Instantiate Aspose Storage API SDK
		StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);

		// Instantiate Aspose Words API SDK
		WordsApi wordsApi = new WordsApi(Configuration.apiKey, Configuration.appSID, true);
		File input = Utils.stream2file("SampleWordDocument","docx", context.getResources().openRawResource(R.raw.docsample));


		// set input file name
		String fileName = "SampleProtectedBlankWordDocument.docx";
		String destFileName = fileName;
		String storage = null;
		String folder = null;

		// upload input file to aspose cloud storage
		storageApi.PutCreate(fileName, "", "", input);

		// invoke Aspose.Words Cloud SDK API to modify protection of a word
		// document
		ProtectionDataResponse apiResponse = wordsApi.GetDocumentProtection(fileName, storage,
				folder);

		if (apiResponse != null && apiResponse.getStatus().equals("OK")) {

			System.out.println(
					"Get Document protection completed successfully");
		}

	} catch (Exception e) {
		e.printStackTrace();
	}
	// ExEnd: GetProtectionWordDocumentExample

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

示例9: execute

import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void execute(Context context) throws Exception {
//ExStart: 1
		String fileName = "input.pdf";
		String templateFile = "";
		String dataFile = "";
		String templateType = "";
		String storage = "";
		String folder = "";
		File input = Utils.stream2file("input","pdf", context.getResources().openRawResource(R.raw.sample_input));

		try
		{
			StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
			// Instantiate Aspose Words API SDK
			PdfApi pdfApi = new PdfApi(Configuration.apiKey, Configuration.appSID, true);
		    // Upload source file to aspose cloud storage
		    storageApi.PutCreate(fileName, "", "", input);
		    // Invoke Aspose.PDF Cloud SDK API to create empty pdf file
		    DocumentResponse apiResponse = pdfApi.PutCreateDocument(fileName, templateFile, dataFile, templateType, storage, folder);
		    if (apiResponse != null && apiResponse.getStatus().equals("OK"))
		    {
		        System.out.println("Create Empty PDF, Done!");
		    }
		}
		catch (Exception ex)
		{
		   ex.printStackTrace();
		}
//ExEnd:  1

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

示例10: execute

import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void execute(Context context) throws IOException {
	//ExStart: get-max-row-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";
		File inputFile = Utils.stream2file("sample1","xlsx", context.getResources().openRawResource(R.raw.sample1));

		String sheetName = "Sheet1";
		String cellOrMethodName = "maxrow";

		storageApi.PutCreate(input, null, Utils.STORAGE, inputFile);

		Integer apiResponse = cellsApi.GetWorksheetCellProperty(input, sheetName, cellOrMethodName, Utils.STORAGE,
				Utils.FOLDER);
		System.out.println(" MaxRow :: " + apiResponse);
	}

	catch (Exception e) {
		e.printStackTrace();
	}
	//ExEnd: get-max-row-worksheet

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

示例11: main

import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void main(String[] args) {
	//ExStart: 1
	String fileName = "sample-input.pptx";
	int width = 0;
	int height = 0;
	int from = 2;
	int to = 3;
	String destFolder = "";
	String format = "png";
	String storage = "";
	String folder = "";

	Path inputFile = Utils.getPath(ConvertPowerPointDocuments.class, fileName);
	try
	{
		SlidesApi slidesApi = new SlidesApi(Configuration.apiKey, Configuration.appSID); 
		StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);


	    // Upload source file to aspose cloud storage
	    storageApi.PutCreate(fileName, "", "", inputFile.toFile());

	    // Invoke Aspose.Slides Cloud SDK API to split powerpoint presentations
	    SplitDocumentResponse apiResponse = slidesApi.
	    										PostSlidesSplit(fileName, width, height, to, from, destFolder, format, storage, folder);

	    if (apiResponse != null)
	    {
	       
	        System.out.println("Split PowerPoint Presentations, Done!");
	        
	    }
	}
	catch (Exception ex)
	{
	    ex.printStackTrace();
	}
	//ExEnd: 1
}
 
开发者ID:aspose-slides,项目名称:Aspose.Slides-for-Cloud,代码行数:40,代码来源:SplitPowerPointPresentations.java

示例12: execute

import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void execute(Context context) throws Exception {
//ExStart: 1
		String fileName = "Sample-Annotation.pdf";
		String storage = "";
		String folder = "";
		File input = Utils.stream2file("input","pdf", context.getResources().openRawResource(R.raw.Sample_Annotation));

		try
		{
			StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
			// Instantiate Aspose Words API SDK
			PdfApi pdfApi = new PdfApi(Configuration.apiKey, Configuration.appSID, true);
		    // Upload source file to aspose cloud storage
		    storageApi.PutCreate(fileName, "", "", input);

		    // Invoke Aspose.PDF Cloud SDK API to get all document properies
		    DocumentPropertiesResponse apiResponse = pdfApi.GetDocumentProperties(fileName, storage, folder);

		    if (apiResponse != null && apiResponse.getStatus().equals("OK"))
		    {
		        for (DocumentProperty docProp : apiResponse.getDocumentProperties().getList())
		        {
		        	System.out.println(docProp.getName() + " :: " + docProp.getValue());
		        }
		        System.out.println("Get All Document Properties from a PDF, Done!");
		    }
		}
		catch (Exception ex)
		{
		    ex.printStackTrace();
		}
//ExEnd:  1
	}
 
开发者ID:aspose-pdf,项目名称:Aspose.Pdf-for-Cloud,代码行数:34,代码来源:GetAllDocumentPropertiesExample.java

示例13: main

import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void main(String[] args) {
	//ExStart: AddAssignmentToProjectExample
	// Set input file name            
	String name = "sample-project.mpp";
	int taskUid = 1;
	int resourceUid = 1;
	Double units = 1.0;
	String fileName = "";
	String storage = "";
	String folder = "";
	Path inputFile = Utils.getPath(DeleteCalendarFromProjectExample.class, name);

	try
	{
		StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);
		// Instantiate Aspose Words API SDK
		TasksApi tasksApi = new TasksApi(Configuration.apiKey, Configuration.appSID, true);
	    // Upload source file to aspose cloud storage
	    storageApi.PutCreate(name, "", "", inputFile.toFile());

	    // Invoke Aspose.Tasks Cloud SDK API to add assignment to project
	    AssignmentItemResponse apiResponse = tasksApi.PostProjectAssignment(name, taskUid, resourceUid, units, fileName, storage, folder);

	    if (apiResponse != null && apiResponse.getStatus().equals("OK"))
	    {
	    	System.out.println("Add Assignment to Project , Done!");
	    }
	}
	catch (Exception ex)
	{
		 ex.printStackTrace();
	}
	//ExEnd: AddAssignmentToProjectExample
}
 
开发者ID:aspose-tasks,项目名称:Aspose.Tasks-for-Cloud,代码行数:35,代码来源:AddAssignmentToProjectExample.java

示例14: executeReadBarcodeFromAsposeCloudStorage

import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void executeReadBarcodeFromAsposeCloudStorage() {

		// ExStart:ReadBarcodeFromAsposeCloudStorage

		try {

			// Instantiate Aspose Storage Cloud API SDK
			StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);

			// Instantiate Aspose BarCode Cloud API SDK
			BarcodeApi barcodeApi = new BarcodeApi(Configuration.apiKey, Configuration.appSID, true);

			// set input file name
			String name = "sample-barcode.jpeg";
			
			//The barcode type.
			//If this parameter is empty, autodetection of all supported types is used.
			String type = "";
			
			//Sets mode for checksum validation during recognition
			String checksumValidation = "";
			
			//Sets if FNC symbol stripping should be performed. 
			Boolean stripFnc = Boolean.TRUE;

			//Sets recognition of rotated barcode
			Integer rotationAngle = Integer.MIN_VALUE;
			
			//Sets exact number of barcodes to recognize 
			Integer barcodesCount = Integer.MIN_VALUE;
			
			//Set recognition of barcode inside specified Rectangle region
			Integer rectX = Integer.SIZE;
			Integer rectY = Integer.SIZE;			
			Integer rectWidth = Integer.MIN_VALUE;
			Integer rectHeight = Integer.MIN_VALUE;
			
			//Set 3rd party cloud storage server (if any)
			String storage = "";
			
			// Set folder location at cloud storage
			String folder = "";

			// upload files to aspose cloud storage
			storageApi.PutCreate(name, "", "",
					new File(ReadBarcodeFromAsposeCloudStorage.class
							.getResource("/" + name).toURI()));

			// invoke Aspose.BarCode Cloud SDK API to read barcode from Aspose
			// Cloud Storage
			BarcodeResponseList apiResponse = barcodeApi.GetBarcodeRecognize(
					name, type, checksumValidation, stripFnc, rotationAngle,
					barcodesCount, rectX, rectY, rectWidth, rectHeight,
					storage, folder);

			if (apiResponse != null && apiResponse.getStatus().equals("OK")) {

				for (Barcode barcode : apiResponse.getBarcodes()) {
					Log.d("aspose-example","Codetext: " + barcode.getBarcodeValue()
							+ " Type: " + barcode.getBarcodeType());
				}
			}

		} catch (Exception e) {
			e.printStackTrace();
		}
		//ExEnd: ReadBarcodeFromAsposeCloudStorage
	}
 
开发者ID:aspose-barcode,项目名称:Aspose.BarCode-for-Cloud,代码行数:69,代码来源:ReadBarcodeFromAsposeCloudStorage.java

示例15: execute

import com.aspose.storage.api.StorageApi; //导入方法依赖的package包/类
public static void execute(Context context) throws Exception {
	// ExStart: ReadingFontInformationFromDocumentExample

	try {
		// Instantiate Aspose Storage API SDK
		StorageApi storageApi = new StorageApi(Configuration.apiKey, Configuration.appSID, true);

		// Instantiate Aspose Words API SDK
		WordsApi wordsApi = new WordsApi(Configuration.apiKey, Configuration.appSID, true);

		// set input file name
		String fileName = "SampleWordDocument.docx";
		File input = Utils.stream2file("SampleWordDocument","docx", context.getResources().openRawResource(R.raw.docsample));

		Integer index = 0;
		Integer runIndex = 0;
		String storage = null;
		String folder = null;

		// upload input file to aspose cloud storage
		storageApi.PutCreate(fileName, "", "",input);

		// invoke Aspose.Words Cloud SDK API to get a font related
		// information of a specific run of a paragraph from a word document
		FontResponse apiResponse = wordsApi.GetDocumentParagraphRunFont(fileName, index, runIndex, storage, folder);

		if (apiResponse != null && apiResponse.getStatus().equals("OK")) {

			Font runFont = apiResponse.getFont();
			// display run font info
			if (runFont != null) {
				System.out.println("Font Name : " + runFont.getName());
				System.out.println("Style : " + runFont.getStyleName());
				System.out.println("Size : " + runFont.getSize());
			}
		}

	} catch (Exception e) {
		e.printStackTrace();
	}
	// ExEnd: ReadingFontInformationFromDocumentExample

}
 
开发者ID:aspose-words,项目名称:Aspose.Words-for-Cloud,代码行数:44,代码来源:ReadingFontInformationFromDocumentExample.java


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