Class WSUploadPart


  • public class WSUploadPart
    extends java.lang.Object
    Class holding the part that is about a file to be uploaded in the web server.
    Author:
    Christopher Mindus
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.lang.String fileName
      The file name parsed from the multi-part.
      java.lang.String name
      The part name.
      long size
      The part size in bytes.
    • Constructor Summary

      Constructors 
      Constructor Description
      WSUploadPart​(java.lang.String fileName, java.lang.String name, long size)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.File getFile()
      Gets the file written on disk.
      void onWritten​(java.io.File file)
      Called when the file has been written to disk.
      java.lang.String toString()
      Outputs to string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • fileName

        public final java.lang.String fileName
        The file name parsed from the multi-part.
      • name

        public final java.lang.String name
        The part name.
      • size

        public final long size
        The part size in bytes.
    • Constructor Detail

      • WSUploadPart

        public WSUploadPart​(java.lang.String fileName,
                            java.lang.String name,
                            long size)
        Constructor.
        Parameters:
        fileName - The file name.
        name - The part name.
        size - The part size in bytes.
    • Method Detail

      • onWritten

        public void onWritten​(java.io.File file)
        Called when the file has been written to disk.
        Parameters:
        file - The file written.
        Throws:
        java.lang.IllegalStateException - If already called.
        java.lang.NullPointerException - If file is null.
      • getFile

        public java.io.File getFile()
        Gets the file written on disk.
        Returns:
        The file, or null if not yet written.
      • toString

        public java.lang.String toString()
        Outputs to string.
        Overrides:
        toString in class java.lang.Object