|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ResourceImport
An interface to a resource being imported, such as a web file upload. All resource access methods must be synchronized on the resource import instance.
| Method Summary | |
|---|---|
long |
getContentLength()
|
com.globalmentor.net.ContentType |
getContentType()
|
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. |
| Method Detail |
|---|
java.lang.String getName()
null if the name is not known.getSimpleName()java.lang.String getSimpleName()
null if the name is not known.getName()com.globalmentor.net.ContentType getContentType()
null if the content type of the resource is not known.long getContentLength()
boolean isImported()
java.io.InputStream getInputStream()
throws java.io.IOException
store(File).
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 getting an input stream to the resource.
void store(java.io.File file)
throws java.io.IOException
getInputStream().
file - 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.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||