|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.itmill.toolkit.terminal.FileResource
public class FileResource
FileResources are files or directories on local filesystem.
The files and directories are served through URI:s to the client terminal and
thus must be registered to an URI context before they can be used. The
resource is automatically registered to the application when it is created.
| Field Summary |
|---|
| Fields inherited from interface com.itmill.toolkit.terminal.ApplicationResource |
|---|
DEFAULT_CACHETIME |
| Constructor Summary | |
|---|---|
FileResource(File sourceFile,
Application application)
Creates a new file resource for providing given file for client terminals. |
|
| Method Summary | |
|---|---|
Application |
getApplication()
Gets the application of the resource. |
int |
getBufferSize()
Gets the size of the download buffer used for this resource. |
long |
getCacheTime()
Gets the length of cache expiration time. |
String |
getFilename()
Gets the virtual filename for this resource. |
String |
getMIMEType()
Gets the MIME type of the resource. |
File |
getSourceFile()
Gets the source file. |
DownloadStream |
getStream()
Gets the resource as stream. |
void |
setBufferSize(int bufferSize)
Sets the size of the download buffer used for this resource. |
void |
setCacheTime(long cacheTime)
Sets the length of cache expiration time. |
void |
setSourceFile(File sourceFile)
Sets the source file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileResource(File sourceFile,
Application application)
| Method Detail |
|---|
public DownloadStream getStream()
getStream in interface ApplicationResourceApplicationResource.getStream()public File getSourceFile()
public void setSourceFile(File sourceFile)
sourceFile - the source file to set.public Application getApplication()
ApplicationResource
getApplication in interface ApplicationResourceApplicationResource.getApplication()public String getFilename()
ApplicationResource
getFilename in interface ApplicationResourceApplicationResource.getFilename()public String getMIMEType()
Resource
getMIMEType in interface ResourceResource.getMIMEType()public long getCacheTime()
DownloadStream.DEFAULT_CACHETIME.
getCacheTime in interface ApplicationResourcepublic void setCacheTime(long cacheTime)
cacheTime - the cache time in milliseconds.public int getBufferSize()
ApplicationResourceIf the buffer size is 0, the buffer size is decided by the terminal adapter. The default value is 0.
getBufferSize in interface ApplicationResourcepublic void setBufferSize(int bufferSize)
bufferSize - the size of the buffer in bytes.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||