Package org.appng.core.domain
Class ResourceImpl
- java.lang.Object
-
- org.appng.core.domain.ResourceImpl
-
- All Implemented Interfaces:
Closeable
,Serializable
,AutoCloseable
,Identifiable<Integer>
,Nameable
,Named<Integer>
,Resource
,Versionable<Date>
,Auditable<Integer>
@Entity public class ResourceImpl extends Object implements Resource, Auditable<Integer>, Closeable
DefaultResource
-implementation- Author:
- Matthias Müller
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ResourceImpl()
ResourceImpl(Application application, Resource resource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
calculateChecksum()
void
close()
Application
getApplication()
String
getAuditName()
@javax.validation.constraints.NotNull byte[]
getBytes()
Returns the byte data of theResource
.File
getCachedFile()
Returns a cached version of theResource
s file.String
getCheckSum()
Returns the checksum of the byte dataString
getDescription()
Returns the description.Integer
getId()
Returns the id.String
getName()
Returns the name.ResourceType
getResourceType()
Returns the type of thisResource
.int
getSize()
Returns the size (in bytes) of thisResource
.Date
getVersion()
Returns the version.void
setApplication(Application application)
void
setBytes(byte[] bytes)
void
setCachedFile(File cachedFile)
Sets the cached version of theResource
s file.void
setCheckSum(String checkSum)
void
setDescription(String description)
void
setId(Integer id)
void
setName(String name)
void
setResourceType(ResourceType type)
void
setVersion(Date version)
-
-
-
Constructor Detail
-
ResourceImpl
public ResourceImpl()
-
ResourceImpl
public ResourceImpl(Application application, Resource resource)
-
-
Method Detail
-
getId
public Integer getId()
Description copied from interface:Identifiable
Returns the id.- Specified by:
getId
in interfaceIdentifiable<Integer>
- Returns:
- the id
-
setId
public void setId(Integer id)
-
setName
public void setName(String name)
-
getDescription
public String getDescription()
Description copied from interface:Nameable
Returns the description.- Specified by:
getDescription
in interfaceNameable
- Returns:
- the description
-
setDescription
public void setDescription(String description)
-
getVersion
public Date getVersion()
Description copied from interface:Versionable
Returns the version.- Specified by:
getVersion
in interfaceVersionable<Date>
- Returns:
- the version
-
setVersion
public void setVersion(Date version)
-
getApplication
public Application getApplication()
-
setApplication
public void setApplication(Application application)
-
getResourceType
public ResourceType getResourceType()
Description copied from interface:Resource
Returns the type of thisResource
.- Specified by:
getResourceType
in interfaceResource
- Returns:
- the type
-
setResourceType
public void setResourceType(ResourceType type)
-
getBytes
@NotNull public @javax.validation.constraints.NotNull byte[] getBytes()
Description copied from interface:Resource
Returns the byte data of theResource
.
-
setBytes
public void setBytes(byte[] bytes)
-
getCheckSum
public String getCheckSum()
Description copied from interface:Resource
Returns the checksum of the byte data- Specified by:
getCheckSum
in interfaceResource
- Returns:
- the checksum of the byte data
-
setCheckSum
public void setCheckSum(String checkSum)
-
getCachedFile
public File getCachedFile()
Description copied from interface:Resource
Returns a cached version of theResource
s file.- Specified by:
getCachedFile
in interfaceResource
- Returns:
- the cached file
-
setCachedFile
public void setCachedFile(File cachedFile)
Description copied from interface:Resource
Sets the cached version of theResource
s file.- Specified by:
setCachedFile
in interfaceResource
- Parameters:
cachedFile
- the cached file
-
getSize
public int getSize()
Description copied from interface:Resource
Returns the size (in bytes) of thisResource
.
-
calculateChecksum
public void calculateChecksum()
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
getAuditName
public String getAuditName()
- Specified by:
getAuditName
in interfaceAuditable<Integer>
-
-