|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.guiseframework.model.FileItemResourceImport
public class FileItemResourceImport
A resource import that accesses a web file upload through the Apache commons file item interface.
FileItem| Constructor Summary | |
|---|---|
FileItemResourceImport(FileItem fileItem)
File item constructor. |
|
| Method Summary | |
|---|---|
long |
getContentLength()
|
com.globalmentor.net.ContentType |
getContentType()
|
protected FileItem |
getFileItem()
|
java.io.InputStream |
getInputStream()
Retrieves an input stream to the resource. |
java.lang.String |
getName()
|
java.lang.String |
getSimpleName()
Returns the simple name, such as the filename, of the resource. |
boolean |
isImported()
|
void |
store(java.io.File file)
Convenience method for storing the imported resource in a file. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FileItemResourceImport(FileItem fileItem)
fileItem - The Apache commons file item representing a file upload.
java.lang.NullPointerException - if the given file item is null.| Method Detail |
|---|
protected FileItem getFileItem()
public boolean isImported()
isImported in interface ResourceImportpublic java.lang.String getName()
getName in interface ResourceImportnull if the name is not known.getSimpleName()public java.lang.String getSimpleName()
getSimpleName in interface ResourceImportnull if the name is not known.getName()public com.globalmentor.net.ContentType getContentType()
getContentType in interface ResourceImportnull if the content type of the resource is not known.public long getContentLength()
getContentLength in interface ResourceImport
public java.io.InputStream getInputStream()
throws java.io.IOException
store(File).
getInputStream in interface ResourceImportjava.lang.IllegalStateException - if this resource has already been stored in a file, or an input stream to the resource has already been retrieved.
java.io.IOException - if there is an error getting an input stream to the resource.
public void store(java.io.File file)
throws java.io.IOException
getInputStream().
store in interface ResourceImportfile - The file to which the resource should be written.
java.lang.IllegalStateException - if this resource has already been stored in a file, or an input stream to the resource has already been retrieved.
java.io.IOException - If there is an error writing the resource to the file.public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||