|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.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.vaadin.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 ApplicationResource
ApplicationResource.getStream()
public File getSourceFile()
public void setSourceFile(File sourceFile)
sourceFile
- the source file to set.public Application getApplication()
ApplicationResource
getApplication
in interface ApplicationResource
ApplicationResource.getApplication()
public String getFilename()
ApplicationResource
getFilename
in interface ApplicationResource
ApplicationResource.getFilename()
public String getMIMEType()
Resource
getMIMEType
in interface Resource
Resource.getMIMEType()
public long getCacheTime()
DownloadStream.DEFAULT_CACHETIME
.
getCacheTime
in interface ApplicationResource
public void setCacheTime(long cacheTime)
cacheTime
- the cache time in milliseconds.public int getBufferSize()
ApplicationResource
If the buffer size is 0, the buffer size is decided by the terminal adapter. The default value is 0.
getBufferSize
in interface ApplicationResource
public 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 |