azkaban.utils.Utils.createTempDir()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(153)

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

Utils.createTempDir介绍

暂无

代码示例

代码示例来源:origin: azkaban/azkaban

public static File createTempDir() {
 return createTempDir(new File(System.getProperty("java.io.tmpdir")));
}

代码示例来源:origin: azkaban/azkaban

private File unzipFile(final File archiveFile) throws IOException {
 final ZipFile zipfile = new ZipFile(archiveFile);
 final File unzipped = Utils.createTempDir(this.tempDir);
 Utils.unzip(zipfile, unzipped);
 zipfile.close();
 return unzipped;
}

代码示例来源:origin: azkaban/azkaban

/**
  * An insecure zip file may hold path traversal filenames. During unzipping, the filename gets
  * concatenated to the target directory. The final path may end up outside the target directory,
  * causing security issues.
  *
  * @throws IOException the io exception
  */
 @Test
 public void testUnzipInsecureFile() throws IOException {
  final File zipFile = new File("myTest.zip");
  try {
   try (final ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile))) {
    final ZipEntry entry = new ZipEntry("../../../../../evil.txt");
    out.putNextEntry(entry);
   }

   final ZipFile source = new ZipFile(zipFile);
   final File dest = Utils.createTempDir();
   assertThatThrownBy(() -> Utils.unzip(source, dest)).isInstanceOf(IOException.class)
     .hasMessageContaining("Extracting zip entry would have resulted in a file outside the "
       + "specified destination directory.");
  } finally {
   if (zipFile.exists()) {
    zipFile.delete();
   }
  }
 }
}

代码示例来源:origin: azkaban/azkaban

final File tempDir = Utils.createTempDir();
OutputStream out = null;
try {

代码示例来源:origin: azkaban/azkaban

final File tempDir = Utils.createTempDir();
final File archiveFile = new File(tempDir, filename);
try {

代码示例来源:origin: com.linkedin.azkaban/azkaban

public static File createTempDir() {
  return createTempDir(new File(System.getProperty("java.io.tmpdir")));
}

代码示例来源:origin: com.linkedin.azkaban/az-core

public static File createTempDir() {
 return createTempDir(new File(System.getProperty("java.io.tmpdir")));
}

代码示例来源:origin: com.linkedin.azkaban/azkaban

private File unzipFile(File archiveFile) throws IOException {
  ZipFile zipfile = new ZipFile(archiveFile);
  File unzipped = Utils.createTempDir(tempDir);
  Utils.unzip(zipfile, unzipped);
  return unzipped;
}

代码示例来源:origin: com.linkedin.azkaban/azkaban-common

private File unzipFile(final File archiveFile) throws IOException {
 final ZipFile zipfile = new ZipFile(archiveFile);
 final File unzipped = Utils.createTempDir(this.tempDir);
 Utils.unzip(zipfile, unzipped);
 zipfile.close();
 return unzipped;
}

代码示例来源:origin: com.linkedin.azkaban/azkaban

File tempDir = Utils.createTempDir();
OutputStream out = null;
try {

相关文章