Package net.sf.basedb.core
Enum Class Location
- All Implemented Interfaces:
Serializable
,Comparable<Location>
,Constable
This enumeration defines constants that are used to specify different
file storage locations.
- Version:
- 2.0
- Author:
- enell
- Last modified
- $Date: 2019-02-22 08:21:20 +0100 (fre, 22 feb. 2019) $
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate final String
Returned by the toString method.private final boolean
If the file can be downloaded from this location.private final boolean
If this location is limited by quota.private final int
The integer value of this location.Maps an integer to a location. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Location
fromValue
(int value) Get theLocation
object when you know the integer code.int
getValue()
Get the integer value that is used when storing an location to the database.boolean
A flag indicating if a file that is stored at this location can be downloaded by a call toFile.getDownloadStream(long)
orFile.download(java.io.OutputStream, long)
.boolean
A flag indicating if a file that is stored at this location should be included in quota limit.toString()
static Location
Returns the enum constant of this class with the specified name.static Location[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
OFFLINE
The item is offline and doesn't use any quota. -
PRIMARY
The item is stored in primary storage. -
EXTERNAL
The item is stored externally. Some information like size, md5, etc. may not be available.- Since:
- 2.16
-
-
Field Details
-
valueMapping
Maps an integer to a location. -
value
private final int valueThe integer value of this location. -
displayValue
Returned by the toString method. -
downloadable
private final boolean downloadableIf the file can be downloaded from this location. -
quotaLimited
private final boolean quotaLimitedIf this location is limited by quota.
-
-
Constructor Details
-
Location
Creates a new location. Used internal only.- Parameters:
value
- The integer value of this location.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
toString
-
fromValue
Get theLocation
object when you know the integer code.- Parameters:
value
- The integer value.- Returns:
- The location for the integer value.
-
getValue
public int getValue()Get the integer value that is used when storing an location to the database.- Returns:
- The integer value for this location.
-
isDownloadable
public boolean isDownloadable()A flag indicating if a file that is stored at this location can be downloaded by a call toFile.getDownloadStream(long)
orFile.download(java.io.OutputStream, long)
.- Returns:
- TRUE if the file can downloaded, FALSE if not
- Since:
- 2.16
-
isQuotaLimited
public boolean isQuotaLimited()A flag indicating if a file that is stored at this location should be included in quota limit.- Returns:
- TRUE if this location is quota limited, FALSE otherwise
- Since:
- 2.16
-