本文整理了Java中org.apache.jena.atlas.io.IO.openOutputFile()
方法的一些代码示例,展示了IO.openOutputFile()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IO.openOutputFile()
方法的具体详情如下:
包路径:org.apache.jena.atlas.io.IO
类名称:IO
方法名:openOutputFile
[英]Open a file for output - may include adding gzip processing.
[中]打开一个文件进行输出-可能包括添加gzip处理。
代码示例来源:origin: apache/jena
private OutputStream openURL(String filename) {
return IO.openOutputFile(filename);
}
}
代码示例来源:origin: apache/jena
/**
* Create an {@link StreamRDF} for output. A filenames ending {@code .gz} or {@code .bz2} will have
* the respective compressor added to the output path. A filename of "-" is {@code System.out}.
* The file is closed when {@link StreamRDF#finish()} is called unless it is {@code System.out}.
* Call {@link StreamRDF#start()}...{@link StreamRDF#finish()}.
*
* @param filename The file
* @param withValues - whether to encode numeric values as values.
* @return StreamRDF A stream to send to.
*/
public static StreamRDF streamToFile(String filename, boolean withValues) {
OutputStream out = IO.openOutputFile(filename) ;
BufferedOutputStream bout = new BufferedOutputStream(out, BUFSIZE_OUT) ;
TProtocol protocol = TRDF.protocol(bout) ;
return new StreamRDF2Thrift(protocol, withValues) ;
}
代码示例来源:origin: org.seaborne.rdf-delta/rdf-delta-client
/** Connect to a destination for changes */
public static RDFChanges destination(String dest) {
// TODO text vs binary
if ( dest.startsWith("file:") ) {
OutputStream out = IO.openOutputFile(dest) ;
TokenWriter tokenWriter = new TokenWriterText(out) ;
RDFChanges sc = new RDFChangesWriter(tokenWriter) ;
return sc ;
}
if ( dest.startsWith("delta:") ) { // TCP connection delta:HOST:PORT
throw new NotImplemented(dest) ;
}
if ( dest.startsWith("http:") || dest.startsWith("https:") ) {
// Triggered on each transaction.
return new RDFChangesHTTP(dest, dest) ;
}
throw new IllegalArgumentException("Not understood: "+dest) ;
}
代码示例来源:origin: apache/jena
try ( OutputStream outCopy = IO.openOutputFile(systemFileCopy) ) {
RDFDataMgr.write(outCopy, model, Lang.TURTLE) ;
try ( OutputStream outCopy = IO.openOutputFile(configFile) ) {
RDFDataMgr.write(outCopy, model, Lang.TURTLE) ;
代码示例来源:origin: org.apache.jena/jena-fuseki-webapp
try ( OutputStream outCopy = IO.openOutputFile(systemFileCopy) ) {
RDFDataMgr.write(outCopy, model, Lang.TURTLE) ;
try ( OutputStream outCopy = IO.openOutputFile(configFile) ) {
RDFDataMgr.write(outCopy, model, Lang.TURTLE) ;
内容来源于网络,如有侵权,请联系作者删除!