Java Tool Kit

ITT.WAFr.Utilities
Class Upload.PostedFile

java.lang.Object
  extended byITT.WAFr.Utilities.Upload.PostedFile
Enclosing class:
Upload

public final class Upload.PostedFile
extends Object

The PostedFile class represents the content and properties of a posted "multipart/form-data" encoded file.

The class does not have a public constructor, and can only be instantiated using the Upload.File(String) method.

See Also:
Upload.File(String)

Method Summary
 byte[] Bytes()
          Retrieves a byte array representing the file content contained within the current PostedFile object.
 String Content()
          Retrieves the String representation of the file content contained within the current PostedFile object.
 String ContentType()
          Retrieves the MIME content type of the file contained within the current PostedFile object.
 boolean HasContent()
          Retrieves a boolean indicating if the current PostedFile object contains any content.
 String Name()
          Retrieves the name of the file without the absolute path for the file contained within the current PostedFile object.
 String Path()
          Retrieves the absolute path to the file on the client machine in which the PostedFile originated.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

Bytes

public byte[] Bytes()
Retrieves a byte array representing the file content contained within the current PostedFile object.

It is not necessary to call the HasContent() method to verify if the PostedFile contains content before calling this method as it will return null if no content is found.

Returns:
a null byte[] object if no content, or a byte array containing the PostedFile content.
See Also:
Content()

Content

public String Content()
Retrieves the String representation of the file content contained within the current PostedFile object.

It is not necessary to call the HasContent() method to verify if the PostedFile contains content before calling this method as it will return null if no content is found.

Returns:
null if no content, or the String value of the PostedFile content.
See Also:
Bytes()

ContentType

public String ContentType()
Retrieves the MIME content type of the file contained within the current PostedFile object.

Returns:
an empty-String value if no file, or the String value of the MIME content type for the PostedFile.

HasContent

public boolean HasContent()
Retrieves a boolean indicating if the current PostedFile object contains any content.

Returns:
true if the PostedFile has file content, false if the file is empty.

Name

public String Name()
Retrieves the name of the file without the absolute path for the file contained within the current PostedFile object.

Returns:
an empty-String value if no file, or the String value of the name of the file.
See Also:
Path()

Path

public String Path()
Retrieves the absolute path to the file on the client machine in which the PostedFile originated.

Returns:
an empty-String value if no file, or the String value of the absolute path to the file.
See Also:
Name()

Java Tool Kit

Copyright ©2004, If•Then Technology