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 TypeFieldDescription
      java.lang.StringfileName
      The file name parsed from the multi-part.
      java.lang.Stringname
      The part name.
      longsize
      The part size in bytes.
    • Constructor Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      java.io.FilegetFile()
      Gets the file written on disk.
      voidonWritten​(java.io.File file)
      Called when the file has been written to disk.
      java.lang.StringtoString()
      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