org.openide.filesystems.FileUtil.copy()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(106)

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

FileUtil.copy介绍

[英]Copies stream of files.

Please be aware, that this method doesn't close any of passed streams.
[中]复制文件流。
请注意,此方法不会关闭任何传递的流。

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-filesystems

private InputStream getMemInputStream(JarFile jf, JarEntry je)
throws IOException {
  InputStream is = getInputStream4336753(jf, je);
  ByteArrayOutputStream os = new ByteArrayOutputStream(is.available());
  try {
    FileUtil.copy(is, os);
  } finally {
    os.close();
  }
  return new ByteArrayInputStream(os.toByteArray());
}

代码示例来源:origin: org.netbeans.api/org-openide-filesystems

copy(bufIn, bufOut);
  copyAttributes(source, dest);
} finally {

代码示例来源:origin: org.netbeans.api/org-openide-filesystems

FileUtil.copy(is, os);
} finally {
  os.close();

代码示例来源:origin: org.netbeans.api/org-openide-filesystems

copy(jis, os);
} finally {
  os.close();

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-j2ee-sun-appsrv81

public void writeDeploymentScript(OutputStream os, Object moduleType) throws IOException {
  InputStream is = AntDeploymentProviderImpl.class.getResourceAsStream("ant-deploy.xml"); // NOI18N
    
  try {
    FileUtil.copy(is, os);
  } finally {
    is.close();
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-glassfish-javaee

@Override
public void writeDeploymentScript(OutputStream os, Object moduleType) throws IOException {
  InputStream is = AntDeploymentProviderImpl.class.getResourceAsStream("ant-deploy.xml"); // NOI18N            
  try {
    FileUtil.copy(is, os);
  } finally {
    is.close();
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-ruby-platform

public static String readAsString(final InputStream is) throws IOException {
  try {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    FileUtil.copy(is, baos);
    return baos.toString("UTF-8"); // NOI18N
  } finally {
    is.close();
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-api-phpmodule

private static void copyZipEntry(ZipFile zipFile, ZipEntry zipEntry, File destinationFile) throws IOException {
  if (zipEntry.isDirectory()) {
    return;
  }
  try (InputStream inputStream = zipFile.getInputStream(zipEntry); FileOutputStream outputStream = new FileOutputStream(destinationFile)) {
    FileUtil.copy(inputStream, outputStream);
  }
}

代码示例来源:origin: nl.cloudfarming.client/isobus-project

private static void writeFile(ZipInputStream str, FileObject fo) throws IOException {
  try (OutputStream out = fo.getOutputStream()) {
    FileUtil.copy(str, out);
  }
}

代码示例来源:origin: nl.cloudfarming.client/fieldplan

private static void writeFile(ZipInputStream str, FileObject fo) throws IOException {
  OutputStream out = fo.getOutputStream();
  try {
    FileUtil.copy(str, out);
  } finally {
    out.close();
  }
}

代码示例来源:origin: nl.cloudfarming.client/stock-project

private static void writeFile(ZipInputStream str, FileObject fo) throws IOException {
  try (OutputStream out = fo.getOutputStream()) {
    FileUtil.copy(str, out);
  }
}

代码示例来源:origin: nl.cloudfarming.client/field-project

private static void writeFile(ZipInputStream str, FileObject fo) throws IOException {
  try (OutputStream out = fo.getOutputStream()) {
    FileUtil.copy(str, out);
  }
}

代码示例来源:origin: dcaoyuan/nbscala

private static void writeFile(ZipInputStream str, FileObject fo) throws IOException {
 OutputStream out = fo.getOutputStream();
 try {
  FileUtil.copy(str, out);
 } finally {
  out.close();
 }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

private InputStream getMemInputStream (JarFile jf, JarEntry je) throws IOException  {
  InputStream is = getInputStream4336753(jf, je);
  ByteArrayOutputStream os = new ByteArrayOutputStream(is.available());
  try {
    FileUtil.copy(is, os);
  } finally {
    os.close();
  }
  return new ByteArrayInputStream(os.toByteArray());
}

代码示例来源:origin: nl.cloudfarming.client/sensor-api

private static void writeFile(ZipInputStream str, FileObject fo) throws IOException {
  try (OutputStream out = fo.getOutputStream()) {
    FileUtil.copy(str, out);
  }
}

代码示例来源:origin: nl.cloudfarming.client/farm-project

private static void writeFile(ZipInputStream str, FileObject fo) throws IOException {
  try (OutputStream out = fo.getOutputStream()) {
    FileUtil.copy(str, out);
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

private InputStream getMemInputStream (JarFile jf, JarEntry je) throws IOException  {
  InputStream is = getInputStream4336753(jf, je);
  ByteArrayOutputStream os = new ByteArrayOutputStream(is.available());
  try {
    FileUtil.copy(is, os);
  } finally {
    os.close();
  }
  return new ByteArrayInputStream(os.toByteArray());
}

代码示例来源:origin: AlexFalappa/nb-springboot

private static void writeFile(ZipInputStream zis, FileObject fo) throws IOException {
  try (OutputStream out = fo.getOutputStream()) {
    FileUtil.copy(zis, out);
  }
}

代码示例来源:origin: AlexFalappa/nb-springboot

private static void writeFile(ZipInputStream str, FileObject fo) throws IOException {
  try (OutputStream out = fo.getOutputStream()) {
    FileUtil.copy(str, out);
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-project

private void copyContent(File file, TmpLocalFile localTmpFile) throws IOException {
  FileObject fileObject = FileUtil.toFileObject(file);
  if (fileObject == null || !fileObject.isValid()) {
    return;
  }
  try (InputStream inputStream = fileObject.getInputStream(); OutputStream outputStream = localTmpFile.getOutputStream()) {
    FileUtil.copy(inputStream, outputStream);
  }
}

相关文章

微信公众号

最新文章

更多