Tabnine Logo
FileUtils$FileCopyResult.addFile
Code IndexAdd Tabnine to your IDE (free)

How to use
addFile
method
in
org.apache.druid.java.util.common.FileUtils$FileCopyResult

Best Java code snippets using org.apache.druid.java.util.common.FileUtils$FileCopyResult.addFile (Showing top 3 results out of 315)

origin: apache/incubator-druid

/**
 * Unzip from the input stream to the output directory, using the entry's file name as the file name in the output directory.
 * The behavior of directories in the input stream's zip is undefined.
 * If possible, it is recommended to use unzip(ByteStream, File) instead
 *
 * @param in     The input stream of the zip data. This stream is closed
 * @param outDir The directory to copy the unzipped data to
 *
 * @return The FileUtils.FileCopyResult containing information on all the files which were written
 *
 * @throws IOException
 */
public static FileUtils.FileCopyResult unzip(InputStream in, File outDir) throws IOException
{
 try (final ZipInputStream zipIn = new ZipInputStream(in)) {
  final FileUtils.FileCopyResult result = new FileUtils.FileCopyResult();
  ZipEntry entry;
  while ((entry = zipIn.getNextEntry()) != null) {
   final File file = new File(outDir, entry.getName());
   validateZipOutputFile("", file, outDir);
   NativeIO.chunkedCopy(zipIn, file);
   result.addFile(file);
   zipIn.closeEntry();
  }
  return result;
 }
}
origin: apache/incubator-druid

 NativeIO.chunkedCopy(in, outFile);
result.addFile(outFile);
origin: org.apache.druid/java-util

/**
 * Unzip from the input stream to the output directory, using the entry's file name as the file name in the output directory.
 * The behavior of directories in the input stream's zip is undefined.
 * If possible, it is recommended to use unzip(ByteStream, File) instead
 *
 * @param in     The input stream of the zip data. This stream is closed
 * @param outDir The directory to copy the unzipped data to
 *
 * @return The FileUtils.FileCopyResult containing information on all the files which were written
 *
 * @throws IOException
 */
public static FileUtils.FileCopyResult unzip(InputStream in, File outDir) throws IOException
{
 try (final ZipInputStream zipIn = new ZipInputStream(in)) {
  final FileUtils.FileCopyResult result = new FileUtils.FileCopyResult();
  ZipEntry entry;
  while ((entry = zipIn.getNextEntry()) != null) {
   final File file = new File(outDir, entry.getName());
   validateZipOutputFile("", file, outDir);
   NativeIO.chunkedCopy(zipIn, file);
   result.addFile(file);
   zipIn.closeEntry();
  }
  return result;
 }
}
org.apache.druid.java.util.commonFileUtils$FileCopyResultaddFile

Popular methods of FileUtils$FileCopyResult

  • size
  • <init>
  • addFiles
  • getFiles
  • addSizedFiles

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (Timer)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • compareTo (BigDecimal)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JList (javax.swing)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now