|
PAJES 2.3.9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.pajes.servlet.UploadedFile
A representation of a file which has been uploaded to the server. The
uploaded file instance is retrieved using the PajeServlet.getUploadedFile(javax.servlet.http.HttpServletRequest, java.lang.String) method. The names of the available files can
be retrieved using PajeServlet.getUploadedFileNames(javax.servlet.http.HttpServletRequest).
Uploaded files are created as temporary files that are set to be deleted on exit if they are not moved or renamed.
| Method Summary | |
boolean |
canRead()
Tests whether the application can read the file. |
boolean |
canWrite()
Tests whether the application can modify to the file. |
boolean |
delete()
Deletes the file or directory. |
boolean |
exists()
Tests whether the file exists. |
java.lang.String |
getAbsolutePath()
Returns the absolute pathname string of this abstract pathname. |
java.lang.String |
getCanonicalPath()
Returns the canonical pathname string of this abstract pathname. |
java.lang.String |
getMIMEType()
Returns the MIME content type of this file. |
java.lang.String |
getName()
Returns the name of the file or directory denoted by this abstract pathname. |
java.lang.String |
getParent()
Returns the pathname string of this abstract pathname's parent, or null if this pathname does not name a parent directory. |
java.lang.String |
getPath()
Converts this abstract pathname into a pathname string. |
java.lang.String |
getSourceFileName()
Returns the source file name from the client browser. |
boolean |
isAbsolute()
Tests whether this abstract pathname is absolute. |
boolean |
isDirectory()
Tests whether the file is a directory. |
boolean |
isFile()
Tests whether the file is a normal file. |
long |
lastModified()
Returns the time that the file was last modified. |
long |
length()
Returns the length of the file. |
boolean |
moveTo(java.io.File dest)
Moves the file to the new file. |
boolean |
renameTo(java.io.File dest)
Renames the file. |
boolean |
wasReplaced()
Determines whether the file already existed before being uploaded or moved, and was therefore replaced. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public boolean isAbsolute()
"/". On Win32 systems, a
pathname is absolute if its prefix is a drive specifier followed by
"\\" , or if its prefix is "\\".
true if this abstract pathname is absolute,
false otherwise.public java.lang.String getAbsolutePath()
If this abstract pathname is already absolute, then the pathname string
is simply returned as if by the method.
If this abstract pathname is the empty abstract pathname then the
pathname string of the current user directory, which is named by the
system property getPath()user.dir, is returned. Otherwise this
pathname is resolved in a system-dependent way. On UNIX systems, a
relative pathname is made absolute by resolving it against the current
user directory. On Win32 systems, a relative pathname is made absolute
by resolving it against the current directory of the drive named by the
pathname, if any; if not, it is resolved against the current user
directory.
isAbsolute()
public java.lang.String getCanonicalPath()
throws java.io.IOException
Every pathname that denotes an existing file or directory has a unique canonical form. Every pathname that denotes a nonexistent file or directory also has a unique canonical form. The canonical form of the pathname of a nonexistent file or directory may be different from the canonical form of the same pathname after the file or directory is created. Similarly, the canonical form of the pathname of an existing file or directory may be different from the canonical form of the same pathname after the file or directory is deleted.
java.io.IOException - If an I/O error occurs, which is possible because
the construction of the canonical pathname may require
filesystem queries.public boolean isDirectory()
true if and only if the file exists and is
a directory; false otherwise.public boolean isFile()
true if and only if the file denoted by this
abstract pathname exists and is a normal file;
false otherwise.public java.lang.String getMIMEType()
public java.lang.String getName()
public java.lang.String getParent()
null if this pathname does not name a parent directory.
The parent of an abstract pathname consists of the pathname's prefix, if any, and each name in the pathname's name sequence except for the last. If the name sequence is empty then the pathname does not name a parent directory.
null if this pathname does
not name a parent.public java.lang.String getPath()
public java.lang.String getSourceFileName()
public boolean canRead()
true if and only if the file exists and
can be read by the application; false otherwisepublic boolean canWrite()
true if and only if the file system actually
contains a file and the application is allowed to
write to the file; false otherwise.public boolean delete()
true if and only if the file or directory is
successfully deleted; false otherwise.public boolean exists()
true if and only if the file exists;
false otherwise.public long lastModified()
long value representing the time the file was
last modified, measured in milliseconds since the epoch
(00:00:00 GMT, January 1, 1970), or 0L if the file
does not exist or if an I/O error occurs.public long length()
0L if the file does not exist.public boolean moveTo(java.io.File dest)
dest - The new abstract pathname for the named file.
true if and only if the move succeeded;
false otherwise.public boolean renameTo(java.io.File dest)
dest - The new abstract pathname for the named file.
true if and only if the renaming succeeded;
false if the rename fails.public boolean wasReplaced()
true if the file existed, or false if
it did not.
|
PAJES 2.3.9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||