public class FileSetMember extends BasicItem
Modifier and Type | Class and Description |
---|---|
private static class |
FileSetMember.QueryRuntimeFilterImpl |
Modifier and Type | Field and Description |
---|---|
private static QueryRuntimeFilter |
RUNTIME_FILTER
This filter gives everybody read permission to file set members.
|
static Item |
TYPE
The type of item represented by this class.
|
Constructor and Description |
---|
FileSetMember(FileSetMemberData data)
Creates a new member item from the given data.
|
Modifier and Type | Method and Description |
---|---|
static FileSetMember |
getById(DbControl dc,
int id)
Get a
FileSetMember object when you know the ID. |
(package private) FileSetMemberData |
getData()
Get the
BasicData object that holds all data for this item. |
DataFileType |
getDataFileType()
Get the type of the file.
|
String |
getErrorMessage()
Get the error message if the validation failed.
|
File |
getFile()
Get the file this item is representing in the file set.
|
FileSet |
getFileSet()
Get the file set the file is a member of.
|
(package private) static FileSetMember |
getNew(DbControl dc,
FileSet fileSet,
File file,
DataFileType type)
Create a new member in a file set.
|
(package private) PluginPermission |
getPluginPermissions() |
static ItemQuery<FileSetMember> |
getQuery(FileSet fileSet)
Get a query configured to retrieve
FileSetMember items. |
Item |
getType()
Get the type of item represented by the object.
|
(package private) void |
initPermissions(int granted,
int denied)
READ permission is granted to all users.
|
boolean |
isPlatformFile()
Checks if this file is part of the platform/variant the parent
item belongs to.
|
Boolean |
isValid()
Check if the file has been validated and if it passed or not.
|
void |
setValid(Boolean valid,
String errorMessage)
Set the validation status of this member.
|
addAnnotatableParents, addUsingItems, addUsingItems, breakCircularReferences, checkBatchAnnotatableUsage, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, validate
public static final Item TYPE
Item.FILESETMEMBER
,
getType()
private static final QueryRuntimeFilter RUNTIME_FILTER
FileSetMember(FileSetMemberData data)
data
- the data.static FileSetMember getNew(DbControl dc, FileSet fileSet, File file, DataFileType type)
FileSet.setMember(File, DataFileType)
public static FileSetMember getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
FileSetMember
object when you know the ID.dc
- The DbControl
which will be used for
permission checking and database access.id
- The ID of the item to loadFileSetMember
itemItemNotFoundException
- If an item with the specified ID is not foundPermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission to the itemsBaseException
- If there is another errorpublic static ItemQuery<FileSetMember> getQuery(FileSet fileSet) throws BaseException
FileSetMember
items.
Note that the query can only retreive files for a single file set at
a time. If fileSet==null when this method is called the client code must
call AbstractHqlQuery.setEntityParameter(String, BasicItem)
with
a "fileSet" parameter before the query is executed.fileSet
- The file set to get members for (can be null)ItemQuery
objectInvalidUseOfNullException
- If required argument is null.BaseException
- If there is another error.FileSetMemberData getData()
BasicItem
BasicData
object that holds all data for this item.public Item getType()
Identifiable
Item
enumeration.void initPermissions(int granted, int denied) throws BaseException
initPermissions
in class BasicItem
granted
- Permissions that have been granted by the subclassdenied
- Permissions that have been denied by the subclassBaseException
- If the permissions couldn't be initialisedPluginPermission getPluginPermissions()
getPluginPermissions
in class BasicItem
public FileSet getFileSet()
public File getFile()
public DataFileType getDataFileType()
public Boolean isValid()
public void setValid(Boolean valid, String errorMessage)
valid
- If the member file is valid or not, use null to
indicate that no validation has been performederrorMessage
- The error message if the validation failespublic String getErrorMessage()
public boolean isPlatformFile()