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

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

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

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();
 }
org.apache.tomcat.util.http.fileupload.diskDiskFileItemgetString

Javadoc

Returns the contents of the file as a String, using the default character encoding. This method uses #get() to retrieve the contents of the file. TODO Consider making this method throw UnsupportedEncodingException.

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,
  • getOutputStream,
  • setDefaultCharset

Popular in Java

  • Creating JSON documents from java classes using gson
  • setScale (BigDecimal)
  • compareTo (BigDecimal)
  • startActivity (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Menu (java.awt)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Join (org.hibernate.mapping)
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top Vim 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