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


Java GSFileOptionsBuilder类代码示例

本文整理汇总了Java中com.google.appengine.api.files.GSFileOptions.GSFileOptionsBuilder的典型用法代码示例。如果您正苦于以下问题:Java GSFileOptionsBuilder类的具体用法?Java GSFileOptionsBuilder怎么用?Java GSFileOptionsBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


GSFileOptionsBuilder类属于com.google.appengine.api.files.GSFileOptions包,在下文中一共展示了GSFileOptionsBuilder类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeSchema

import com.google.appengine.api.files.GSFileOptions.GSFileOptionsBuilder; //导入依赖的package包/类
public static void writeSchema(FileService fileService, String bucketName, String schemaKey, List<String> fieldNames, List<String> fieldTypes) throws IOException,
FileNotFoundException, FinalizationException, LockException {
	GSFileOptionsBuilder schemaOptionsBuilder = new GSFileOptionsBuilder()
	.setBucket(bucketName)
	.setKey(schemaKey)
	.setAcl("project-private");
	AppEngineFile schemaFile = fileService.createNewGSFile(schemaOptionsBuilder.build());
	FileWriteChannel schemaChannel = fileService.openWriteChannel(schemaFile, true);
	PrintWriter schemaWriter = new PrintWriter(Channels.newWriter(schemaChannel, "UTF8"));
	StringBuilder sb = new StringBuilder();
	for (int i = 0; i < fieldNames.size(); i++) {
		sb.append(fieldNames.get(i) + ":" + fieldTypes.get(i));
		if (i < fieldNames.size() - 1) {
			sb.append(",");
		}
	}
	schemaWriter.print(sb);
	schemaWriter.close();
	schemaChannel.closeFinally();
}
 
开发者ID:steveseo,项目名称:l2bq,代码行数:21,代码来源:AnalysisUtility.java

示例2: doGet

import com.google.appengine.api.files.GSFileOptions.GSFileOptionsBuilder; //导入依赖的package包/类
@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
	try {
	System.out.println(newFileName());
	 FileService fileService = FileServiceFactory.getFileService();
	GSFileOptionsBuilder optionsBuilder = new GSFileOptionsBuilder()
	.setBucket("wt1-test1")
	.setKey(newFileName());

	AppEngineFile aef = fileService.createNewGSFile(optionsBuilder.build());
	
	FileWriteChannel ch = fileService.openWriteChannel(aef, true);
	
	Channels.newWriter(ch, "utf8").append("pouet").flush();
	
	ch.closeFinally();
	System.out.println("SUCCESS **************");
	} catch (Exception e) {
		System.out.println("FAILURE **************************");
		e.printStackTrace();
	}
}
 
开发者ID:dataiku,项目名称:wt1,代码行数:23,代码来源:TestServlet.java

示例3: FancyFileWriter

import com.google.appengine.api.files.GSFileOptions.GSFileOptionsBuilder; //导入依赖的package包/类
public FancyFileWriter(String bucketName, String fileKey) throws IOException {
	lastOpenMillis = System.currentTimeMillis();
	
	log.warning("Creating file " + bucketName + ":" + fileKey);
	GSFileOptionsBuilder optionsBuilder = new GSFileOptionsBuilder()
		.setBucket(bucketName)
		.setKey(fileKey)
		.setAcl("project-private");
	logsFile = fileService.createNewGSFile(optionsBuilder.build());
	init();
}
 
开发者ID:steveseo,项目名称:l2bq,代码行数:12,代码来源:FancyFileWriter.java

示例4: newFile

import com.google.appengine.api.files.GSFileOptions.GSFileOptionsBuilder; //导入依赖的package包/类
/**
 * Create a new file on Cloud storage
 */
private AppEngineFile newFile(String name) throws IOException {
	GSFileOptionsBuilder optionsBuilder = new GSFileOptionsBuilder()
	.setBucket(bucketName)
	.setKey(name);
	return fileService.createNewGSFile(optionsBuilder.build());
}
 
开发者ID:dataiku,项目名称:wt1,代码行数:10,代码来源:GCSGAEStorageProcessor.java


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