diff options
author | Jani Laakso <jani.laakso@itmill.com> | 2007-04-18 05:32:44 +0000 |
---|---|---|
committer | Jani Laakso <jani.laakso@itmill.com> | 2007-04-18 05:32:44 +0000 |
commit | 121ae54f709f887c95592b95bdc09977642b8c3b (patch) | |
tree | 389925b20e51a24428ae8bb625c651c3d9de6ca8 /src/com/itmill/toolkit/terminal/FileResource.java | |
parent | 76d0a503c56656bafc68d732d245dd2dafe1b55d (diff) | |
download | vaadin-framework-121ae54f709f887c95592b95bdc09977642b8c3b.tar.gz vaadin-framework-121ae54f709f887c95592b95bdc09977642b8c3b.zip |
Unified code style (indentation) based on default settings using Eclipse 3.2.
svn changeset:1256/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/terminal/FileResource.java')
-rw-r--r-- | src/com/itmill/toolkit/terminal/FileResource.java | 136 |
1 files changed, 72 insertions, 64 deletions
diff --git a/src/com/itmill/toolkit/terminal/FileResource.java b/src/com/itmill/toolkit/terminal/FileResource.java index 497baa065c..2ca1332f08 100644 --- a/src/com/itmill/toolkit/terminal/FileResource.java +++ b/src/com/itmill/toolkit/terminal/FileResource.java @@ -1,30 +1,30 @@ /* ************************************************************************* - IT Mill Toolkit + IT Mill Toolkit - Development of Browser User Interfaces Made Easy + Development of Browser User Interfaces Made Easy - Copyright (C) 2000-2006 IT Mill Ltd - - ************************************************************************* + Copyright (C) 2000-2006 IT Mill Ltd + + ************************************************************************* - This product is distributed under commercial license that can be found - from the product package on license.pdf. Use of this product might - require purchasing a commercial license from IT Mill Ltd. For guidelines - on usage, see licensing-guidelines.html + This product is distributed under commercial license that can be found + from the product package on license.pdf. Use of this product might + require purchasing a commercial license from IT Mill Ltd. For guidelines + on usage, see licensing-guidelines.html - ************************************************************************* - - For more information, contact: - - IT Mill Ltd phone: +358 2 4802 7180 - Ruukinkatu 2-4 fax: +358 2 4802 7181 - 20540, Turku email: info@itmill.com - Finland company www: www.itmill.com - - Primary source for information and releases: www.itmill.com + ************************************************************************* + + For more information, contact: + + IT Mill Ltd phone: +358 2 4802 7180 + Ruukinkatu 2-4 fax: +358 2 4802 7181 + 20540, Turku email: info@itmill.com + Finland company www: www.itmill.com + + Primary source for information and releases: www.itmill.com - ********************************************************************** */ + ********************************************************************** */ package com.itmill.toolkit.terminal; @@ -35,77 +35,80 @@ import java.io.FileNotFoundException; import com.itmill.toolkit.Application; import com.itmill.toolkit.service.FileTypeResolver; -/** - * <code>FileResources</code> 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. - * +/** + * <code>FileResources</code> 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. + * * @author IT Mill Ltd. - * @version @VERSION@ + * @version + * @VERSION@ * @since 3.0 */ public class FileResource implements ApplicationResource { - /** - * Default buffer size for this stream resource. + /** + * Default buffer size for this stream resource. */ private int bufferSize = 0; - /** - * File where the downloaded content is fetched from. + /** + * File where the downloaded content is fetched from. */ private File sourceFile; - /** - * Application. + /** + * Application. */ private Application application; - /** - * Default cache time for this stream resource. + /** + * Default cache time for this stream resource. */ - private long cacheTime = DownloadStream.DEFAULT_CACHETIME; + private long cacheTime = DownloadStream.DEFAULT_CACHETIME; - /** - * Creates a new file resource for providing given file for - * client terminals. + /** + * Creates a new file resource for providing given file for client + * terminals. */ public FileResource(File sourceFile, Application application) { this.application = application; setSourceFile(sourceFile); application.addResource(this); } - + /** * Gets the resource as stream. + * * @see com.itmill.toolkit.terminal.ApplicationResource#getStream() */ public DownloadStream getStream() { try { - DownloadStream ds = new DownloadStream( - new FileInputStream(this.sourceFile), - getMIMEType(), - getFilename()); + DownloadStream ds = new DownloadStream(new FileInputStream( + this.sourceFile), getMIMEType(), getFilename()); ds.setCacheTime(cacheTime); return ds; } catch (FileNotFoundException e) { - // No logging for non-existing files at this level. + // No logging for non-existing files at this level. return null; } } - /** + /** * Gets the source file. + * * @return the source File. */ public File getSourceFile() { return sourceFile; } - /** + /** * Sets the source file. - * @param sourceFile the source file to set. + * + * @param sourceFile + * the source file to set. */ public void setSourceFile(File sourceFile) { this.sourceFile = sourceFile; @@ -131,37 +134,42 @@ public class FileResource implements ApplicationResource { public String getMIMEType() { return FileTypeResolver.getMIMEType(sourceFile); } - - /** - * Gets the length of cache expiration time. - * This gives the adapter the possibility cache streams sent to the client. - * The caching may be made in adapter or at the client if the client supports - * caching. Default is <code>DownloadStream.DEFAULT_CACHETIME</code>. + + /** + * Gets the length of cache expiration time. This gives the adapter the + * possibility cache streams sent to the client. The caching may be made in + * adapter or at the client if the client supports caching. Default is + * <code>DownloadStream.DEFAULT_CACHETIME</code>. + * * @return Cache time in milliseconds. */ public long getCacheTime() { return cacheTime; } - /** - * Sets the length of cache expiration time. - * This gives the adapter the possibility cache streams sent to the client. - * The caching may be made in adapter or at the client if the client supports - * caching. Zero or negavive value disbales the caching of this stream. - * @param cacheTime the cache time in milliseconds. + /** + * Sets the length of cache expiration time. This gives the adapter the + * possibility cache streams sent to the client. The caching may be made in + * adapter or at the client if the client supports caching. Zero or negavive + * value disbales the caching of this stream. + * + * @param cacheTime + * the cache time in milliseconds. */ public void setCacheTime(long cacheTime) { this.cacheTime = cacheTime; - } - + } + /* documented in superclass */ public int getBufferSize() { return bufferSize; } - /** + /** * Sets the size of the download buffer used for this resource. - * @param bufferSize the size of the buffer in bytes. + * + * @param bufferSize + * the size of the buffer in bytes. */ public void setBufferSize(int bufferSize) { this.bufferSize = bufferSize; |