org.apache.jena.atlas.io.IO.openOutputFile()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(114)

本文整理了Java中org.apache.jena.atlas.io.IO.openOutputFile()方法的一些代码示例,展示了IO.openOutputFile()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IO.openOutputFile()方法的具体详情如下:
包路径:org.apache.jena.atlas.io.IO
类名称:IO
方法名:openOutputFile

IO.openOutputFile介绍

[英]Open a file for output - may include adding gzip processing.
[中]打开一个文件进行输出-可能包括添加gzip处理。

代码示例

代码示例来源:origin: apache/jena

  1. private OutputStream openURL(String filename) {
  2. return IO.openOutputFile(filename);
  3. }
  4. }

代码示例来源:origin: apache/jena

  1. /**
  2. * Create an {@link StreamRDF} for output. A filenames ending {@code .gz} or {@code .bz2} will have
  3. * the respective compressor added to the output path. A filename of "-" is {@code System.out}.
  4. * The file is closed when {@link StreamRDF#finish()} is called unless it is {@code System.out}.
  5. * Call {@link StreamRDF#start()}...{@link StreamRDF#finish()}.
  6. *
  7. * @param filename The file
  8. * @param withValues - whether to encode numeric values as values.
  9. * @return StreamRDF A stream to send to.
  10. */
  11. public static StreamRDF streamToFile(String filename, boolean withValues) {
  12. OutputStream out = IO.openOutputFile(filename) ;
  13. BufferedOutputStream bout = new BufferedOutputStream(out, BUFSIZE_OUT) ;
  14. TProtocol protocol = TRDF.protocol(bout) ;
  15. return new StreamRDF2Thrift(protocol, withValues) ;
  16. }

代码示例来源:origin: org.seaborne.rdf-delta/rdf-delta-client

  1. /** Connect to a destination for changes */
  2. public static RDFChanges destination(String dest) {
  3. // TODO text vs binary
  4. if ( dest.startsWith("file:") ) {
  5. OutputStream out = IO.openOutputFile(dest) ;
  6. TokenWriter tokenWriter = new TokenWriterText(out) ;
  7. RDFChanges sc = new RDFChangesWriter(tokenWriter) ;
  8. return sc ;
  9. }
  10. if ( dest.startsWith("delta:") ) { // TCP connection delta:HOST:PORT
  11. throw new NotImplemented(dest) ;
  12. }
  13. if ( dest.startsWith("http:") || dest.startsWith("https:") ) {
  14. // Triggered on each transaction.
  15. return new RDFChangesHTTP(dest, dest) ;
  16. }
  17. throw new IllegalArgumentException("Not understood: "+dest) ;
  18. }

代码示例来源:origin: apache/jena

  1. try ( OutputStream outCopy = IO.openOutputFile(systemFileCopy) ) {
  2. RDFDataMgr.write(outCopy, model, Lang.TURTLE) ;
  3. try ( OutputStream outCopy = IO.openOutputFile(configFile) ) {
  4. RDFDataMgr.write(outCopy, model, Lang.TURTLE) ;

代码示例来源:origin: org.apache.jena/jena-fuseki-webapp

  1. try ( OutputStream outCopy = IO.openOutputFile(systemFileCopy) ) {
  2. RDFDataMgr.write(outCopy, model, Lang.TURTLE) ;
  3. try ( OutputStream outCopy = IO.openOutputFile(configFile) ) {
  4. RDFDataMgr.write(outCopy, model, Lang.TURTLE) ;

相关文章