Tabnine Logo
DiskFileItem.getOutputStream
Code IndexAdd Tabnine to your IDE (free)

How to use
getOutputStream
method
in
org.apache.tomcat.util.http.fileupload.disk.DiskFileItem

Best Java code snippets using org.apache.tomcat.util.http.fileupload.disk.DiskFileItem.getOutputStream (Showing top 4 results out of 315)

origin: org.apache.geronimo.ext.tomcat/util

/**
 * Reads the state of this object during deserialization.
 *
 * @param in The stream from which the state should be read.
 *
 * @throws IOException if an error occurs.
 * @throws ClassNotFoundException if class cannot be found.
 */
private void readObject(ObjectInputStream in)
    throws IOException, ClassNotFoundException {
  // read values
  in.defaultReadObject();
  OutputStream output = getOutputStream();
  if (cachedContent != null) {
    output.write(cachedContent);
  } else {
    FileInputStream input = new FileInputStream(dfosFile);
    IOUtils.copy(input, output);
    dfosFile.delete();
    dfosFile = null;
  }
  output.close();
  cachedContent = null;
}
origin: stackoverflow.com

final File TEST_FILE = new File("D:/my_text.txt");
 //final DiskFileItem diskFileItem = new DiskFileItem("fileData", "text/plain", true, TEST_FILE.getName(), 100000000, TEST_FILE);
 try
 {
   DiskFileItem fileItem = (DiskFileItem) new DiskFileItemFactory().createItem("fileData", "text/plain", true, TEST_FILE.getName());
   InputStream input =  new FileInputStream(TEST_FILE);
   OutputStream os = fileItem.getOutputStream();
   int ret = input.read();
   while ( ret != -1 )
   {
     os.write(ret);
     ret = input.read();
   }
   os.flush();
   System.out.println("diskFileItem.getString() = " + fileItem.getString());
 }
 catch (Exception e)
 {
   // TODO Auto-generated catch block
   e.printStackTrace();
 }
origin: com.ovea.tajin.server/tajin-server-tomcat7

/**
 * Reads the state of this object during deserialization.
 *
 * @param in The stream from which the state should be read.
 *
 * @throws IOException if an error occurs.
 * @throws ClassNotFoundException if class cannot be found.
 */
private void readObject(ObjectInputStream in)
    throws IOException, ClassNotFoundException {
  // read values
  in.defaultReadObject();
  OutputStream output = getOutputStream();
  if (cachedContent != null) {
    output.write(cachedContent);
  } else {
    FileInputStream input = new FileInputStream(dfosFile);
    IOUtils.copy(input, output);
    dfosFile.delete();
    dfosFile = null;
  }
  output.close();
  cachedContent = null;
}
origin: org.apache.coyote/com.springsource.org.apache.coyote

/**
 * Reads the state of this object during deserialization.
 *
 * @param in The stream from which the state should be read.
 *
 * @throws IOException if an error occurs.
 * @throws ClassNotFoundException if class cannot be found.
 */
private void readObject(ObjectInputStream in)
    throws IOException, ClassNotFoundException {
  // read values
  in.defaultReadObject();
  OutputStream output = getOutputStream();
  if (cachedContent != null) {
    output.write(cachedContent);
  } else {
    FileInputStream input = new FileInputStream(dfosFile);
    IOUtils.copy(input, output);
    dfosFile.delete();
    dfosFile = null;
  }
  output.close();
  cachedContent = null;
}
org.apache.tomcat.util.http.fileupload.diskDiskFileItemgetOutputStream

Javadoc

Returns an java.io.OutputStream that can be used for storing the contents of the file.

Popular methods of DiskFileItem

  • getHeaders
    Returns the file item headers.
  • getStoreLocation
    Returns the java.io.File object for the FileItem's data's temporary location on the disk. Note that
  • <init>
    Constructs a new DiskFileItem instance.
  • get
    Returns the contents of the file as an array of bytes. If the contents of the file were not yet cach
  • getCharSet
    Returns the content charset passed by the agent or null if not defined.
  • getContentType
    Returns the content type passed by the agent or null if not defined.
  • getFieldName
    Returns the name of the field in the multipart form corresponding to this file item.
  • getName
    Returns the original filename in the client's filesystem.
  • getSize
    Returns the size of the file.
  • getTempFile
    Creates and returns a java.io.File representing a uniquely named temporary file in the configured re
  • getUniqueId
    Returns an identifier that is unique within the class loader used to load this class, but does not h
  • isFormField
    Determines whether or not a FileItem instance represents a simple form field.
  • getUniqueId,
  • isFormField,
  • isInMemory,
  • getString,
  • setDefaultCharset

Popular in Java

  • Finding current android device location
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • putExtra (Intent)
  • getContentResolver (Context)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • String (java.lang)
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • JPanel (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