@ThreadSafe public class FileResource extends ResourceSupport implements PropertiesEnabledResource<java.lang.String>, LoggingEnabledResource, FileEnabledResource, PrivateUrlEnabledResource
| Constructor and Description |
|---|
FileResource(java.io.File file,
byte[] md5,
ResourceType type) |
FileResource(java.io.File file,
byte[] md5,
ResourceType type,
boolean generated) |
FileResource(java.io.File file,
ResourceType type) |
FileResource(java.io.File file,
ResourceType type,
boolean generated) |
| Modifier and Type | Method and Description |
|---|---|
java.io.File |
getFile() |
java.util.Date |
getLastModified() |
java.io.File |
getLoggingFile() |
byte[] |
getMd5() |
java.net.URL |
getPrivateUrl() |
java.lang.Iterable<Entry<java.lang.String,java.lang.String>> |
getProperties() |
java.io.File |
getPropertiesFile() |
protected java.util.Properties |
getPropertiesInternal() |
java.lang.String |
getProperty(java.lang.String name) |
java.lang.Class<java.lang.String> |
getPropertyValueType() |
long |
getSize() |
ResourceType |
getType() |
boolean |
isExisting() |
boolean |
isGenerated() |
void |
logMessage(java.lang.String message) |
CloseableIterator<java.lang.String> |
logMessageIterator() |
java.io.InputStream |
openInputStream() |
protected java.lang.String |
readNextMessageOf(java.io.BufferedReader bufferedReader) |
void |
release() |
void |
removeProperty(java.lang.String name) |
protected void |
saveProperties(java.util.Properties properties) |
void |
setProperty(java.lang.String name,
java.lang.Object value) |
void |
touch() |
equals, hashCode, toStringpublic FileResource(@Nonnull
java.io.File file,
@Nonnull
ResourceType type)
public FileResource(@Nonnull
java.io.File file,
@Nullable
byte[] md5,
@Nonnull
ResourceType type)
public FileResource(@Nonnull
java.io.File file,
@Nonnull
ResourceType type,
boolean generated)
public FileResource(@Nonnull
java.io.File file,
@Nullable
byte[] md5,
@Nonnull
ResourceType type,
boolean generated)
@Nonnull
public java.io.InputStream openInputStream()
throws java.io.IOException
openInputStream in interface Resourcejava.io.IOException@Nonnull public ResourceType getType()
@Nonnull
public byte[] getMd5()
throws java.io.IOException
getMd5 in interface ResourcegetMd5 in class ResourceSupportjava.io.IOExceptionpublic long getSize()
getSize in interface ResourcegetSize in class ResourceSupportpublic java.util.Date getLastModified()
getLastModified in interface Resourcepublic boolean isExisting()
throws java.io.IOException
isExisting in interface Resourcejava.io.IOExceptionpublic void release()
throws java.io.IOException
release in interface Resourcerelease in class ResourceSupportjava.io.IOException@Nonnull public java.io.File getPropertiesFile()
@Nonnull
protected java.util.Properties getPropertiesInternal()
throws java.io.IOException
java.io.IOExceptionprotected void saveProperties(@Nonnull
java.util.Properties properties)
throws java.io.IOException
java.io.IOException@Nonnull public java.lang.Iterable<Entry<java.lang.String,java.lang.String>> getProperties() throws java.io.IOException
getProperties in interface PropertiesEnabledResource<java.lang.String>java.io.IOExceptionpublic java.lang.String getProperty(@Nonnull
java.lang.String name)
throws java.io.IOException
getProperty in interface PropertiesEnabledResource<java.lang.String>java.io.IOExceptionpublic void setProperty(@Nonnull
java.lang.String name,
@Nullable
java.lang.Object value)
throws java.io.IOException
setProperty in interface PropertiesEnabledResource<java.lang.String>java.io.IOExceptionpublic void removeProperty(@Nonnull
java.lang.String name)
throws java.io.IOException
removeProperty in interface PropertiesEnabledResource<java.lang.String>java.io.IOException@Nonnull public java.lang.Class<java.lang.String> getPropertyValueType()
getPropertyValueType in interface PropertiesEnabledResource<java.lang.String>@Nonnull public java.io.File getFile()
getFile in interface FileEnabledResource@Nonnull public java.io.File getLoggingFile()
public void logMessage(@Nonnull
java.lang.String message)
throws java.io.IOException
logMessage in interface LoggingEnabledResourcejava.io.IOException@Nonnull public CloseableIterator<java.lang.String> logMessageIterator() throws java.io.IOException
logMessageIterator in interface LoggingEnabledResourcejava.io.IOException@Nullable
protected java.lang.String readNextMessageOf(@Nonnull
java.io.BufferedReader bufferedReader)
public boolean isGenerated()
throws java.io.IOException
isGenerated in interface Resourcejava.io.IOException@Nonnull
public java.net.URL getPrivateUrl()
throws java.io.IOException
getPrivateUrl in interface PrivateUrlEnabledResourcejava.io.IOExceptionpublic void touch()
throws java.io.IOException
touch in interface Resourcetouch in class ResourceSupportjava.io.IOExceptionCopyright © 2015 echocat. All Rights Reserved.