Package ghidra.framework.store.remote
Class RemoteFolderItem
java.lang.Object
ghidra.framework.store.remote.RemoteFolderItem
- All Implemented Interfaces:
FolderItem
- Direct Known Subclasses:
RemoteDatabaseItem
RemoteFolderItem
provides an abstract FolderItem implementation
for an item contained within a remote Repository.-
Field Summary
Modifier and TypeFieldDescriptionprotected final String
protected final String
protected final String
protected final String
protected RepositoryAdapter
protected int
protected long
Fields inherited from interface ghidra.framework.store.FolderItem
DATABASE_FILE_TYPE, DATAFILE_FILE_TYPE, DEFAULT_CHECKOUT_ID, LATEST_VERSION, UNKNOWN_FILE_TYPE
-
Method Summary
Modifier and TypeMethodDescriptioncheckout
(CheckoutType checkoutType, String user, String projectPath) Checkout this folder item.void
Clears the checkout data associated with this non-shared file.void
Deletes the item or a specific version.getCheckout
(long checkoutId) Get the checkout status which corresponds to the specified checkout ID.long
Returns the checkoutId for this file.Get all current checkouts for this item.int
Returns the item version which was checked-out.Return The content type name for this item.int
Returns the version of content type.int
Return the latest/current version.Return the file ID if one has been established or nullint
Returns the local item version at the time the checkout was completed.getName()
Return The display name for this item.Returns the path of the parent folder.Return The concatenation of the pathname and the basename which can be used to uniquely identify a folder item.Version[]
Returns list of all available versions or null if item is not versioned.boolean
Returns true if this item is a checked-out copy from a versioned file system.boolean
Returns true if this item is a checked-out copy with exclusive access from a versioned file system.boolean
Returns true if item can be overwritten/deleted.boolean
Return true if this is a versioned item, else falselong
Return The time that this item was last modified.refresh()
Returns this instance after refresh or null if item no longer existsAssign a new file-ID to this local non-versioned file.void
setCheckout
(long checkoutId, boolean exclusive, int checkoutVersion, int localVersion) Set the checkout data associated with this non-shared file.void
setContentTypeVersion
(int version) Sets the version for the content type.void
setReadOnly
(boolean state) Set the state of the read-only indicator for this non-shared item.void
terminateCheckout
(long checkoutId, boolean notify) Terminates a checkout.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ghidra.framework.store.FolderItem
canRecover, hasCheckouts, isCheckinActive, length, output, updateCheckoutVersion
-
Field Details
-
parentPath
-
itemName
-
contentType
-
fileID
-
version
protected int version -
versionTime
protected long versionTime -
repository
-
-
Method Details
-
getName
Description copied from interface:FolderItem
Return The display name for this item.- Specified by:
getName
in interfaceFolderItem
-
refresh
Description copied from interface:FolderItem
Returns this instance after refresh or null if item no longer exists- Specified by:
refresh
in interfaceFolderItem
- Throws:
IOException
-
getFileID
Description copied from interface:FolderItem
Return the file ID if one has been established or null- Specified by:
getFileID
in interfaceFolderItem
-
resetFileID
Description copied from interface:FolderItem
Assign a new file-ID to this local non-versioned file. NOTE: This method is only valid for a local non-versioned file-system.- Specified by:
resetFileID
in interfaceFolderItem
- Returns:
- new file-ID
-
getContentType
Description copied from interface:FolderItem
Return The content type name for this item.- Specified by:
getContentType
in interfaceFolderItem
-
getParentPath
Description copied from interface:FolderItem
Returns the path of the parent folder.- Specified by:
getParentPath
in interfaceFolderItem
-
getPathName
Description copied from interface:FolderItem
Return The concatenation of the pathname and the basename which can be used to uniquely identify a folder item.- Specified by:
getPathName
in interfaceFolderItem
-
isReadOnly
public boolean isReadOnly()Description copied from interface:FolderItem
Returns true if item can be overwritten/deleted.- Specified by:
isReadOnly
in interfaceFolderItem
-
setReadOnly
public void setReadOnly(boolean state) Description copied from interface:FolderItem
Set the state of the read-only indicator for this non-shared item.- Specified by:
setReadOnly
in interfaceFolderItem
- Parameters:
state
- read-only state
-
getContentTypeVersion
public int getContentTypeVersion()Description copied from interface:FolderItem
Returns the version of content type. Note this is the version of the structure/storage for the content type, Not the users version of their data.- Specified by:
getContentTypeVersion
in interfaceFolderItem
-
setContentTypeVersion
Description copied from interface:FolderItem
Sets the version for the content type. This will change whenever the domain objects are upgraded.- Specified by:
setContentTypeVersion
in interfaceFolderItem
- Parameters:
version
- the new version for the content type.- Throws:
IOException
- if an IO error occurs or item is stored on a shared file-system
-
lastModified
public long lastModified()Description copied from interface:FolderItem
Return The time that this item was last modified.- Specified by:
lastModified
in interfaceFolderItem
-
getCurrentVersion
public int getCurrentVersion()Description copied from interface:FolderItem
Return the latest/current version.- Specified by:
getCurrentVersion
in interfaceFolderItem
-
isVersioned
public boolean isVersioned()Description copied from interface:FolderItem
Return true if this is a versioned item, else false- Specified by:
isVersioned
in interfaceFolderItem
-
getVersions
Description copied from interface:FolderItem
Returns list of all available versions or null if item is not versioned.- Specified by:
getVersions
in interfaceFolderItem
- Throws:
IOException
- thrown if an IO error occurs.
-
delete
Description copied from interface:FolderItem
Deletes the item or a specific version. If a specific version is specified, it must either be the oldest or latest (i.e., current).- Specified by:
delete
in interfaceFolderItem
- Parameters:
ver
- specific version to be deleted, or -1 to remove all versions.user
- user name- Throws:
IOException
- if an IO error occurs, including the inability to delete a version because this item is checked-out, the user does not have permission, or the specified version is not the oldest or latest.
-
isCheckedOut
public boolean isCheckedOut()Description copied from interface:FolderItem
Returns true if this item is a checked-out copy from a versioned file system.- Specified by:
isCheckedOut
in interfaceFolderItem
-
isCheckedOutExclusive
public boolean isCheckedOutExclusive()Description copied from interface:FolderItem
Returns true if this item is a checked-out copy with exclusive access from a versioned file system.- Specified by:
isCheckedOutExclusive
in interfaceFolderItem
-
checkout
public ItemCheckoutStatus checkout(CheckoutType checkoutType, String user, String projectPath) throws IOException Description copied from interface:FolderItem
Checkout this folder item.- Specified by:
checkout
in interfaceFolderItem
- Parameters:
checkoutType
- type of checkoutuser
- user requesting checkoutprojectPath
- path of project where checkout was made- Returns:
- checkout status or null if exclusive checkout request failed
- Throws:
IOException
- if an IO error occurs or this item is not versioned
-
terminateCheckout
Description copied from interface:FolderItem
Terminates a checkout. The checkout ID becomes invalid, therefore the associated checkout copy should either be removed or converted to a private file.- Specified by:
terminateCheckout
in interfaceFolderItem
- Parameters:
checkoutId
- checkout IDnotify
- if true item change notification will be sent- Throws:
IOException
- if an IO error occurs or this item is not versioned
-
getCheckout
Description copied from interface:FolderItem
Get the checkout status which corresponds to the specified checkout ID.- Specified by:
getCheckout
in interfaceFolderItem
- Parameters:
checkoutId
- checkout ID- Returns:
- checkout status or null if checkout ID not found.
- Throws:
IOException
- if an IO error occurs or this item is not versioned
-
getCheckouts
Description copied from interface:FolderItem
Get all current checkouts for this item.- Specified by:
getCheckouts
in interfaceFolderItem
- Returns:
- array of checkouts
- Throws:
IOException
- if an IO error occurs or this item is not versioned
-
clearCheckout
Description copied from interface:FolderItem
Clears the checkout data associated with this non-shared file. NOTE: This method is only valid for a local non-versioned file-system.- Specified by:
clearCheckout
in interfaceFolderItem
- Throws:
IOException
-
getCheckoutId
Description copied from interface:FolderItem
Returns the checkoutId for this file. A value of -1 indicates a private item. NOTE: This method is only valid for a local non-versioned file-system.- Specified by:
getCheckoutId
in interfaceFolderItem
- Throws:
IOException
- if an IO error occurs
-
getCheckoutVersion
Description copied from interface:FolderItem
Returns the item version which was checked-out. A value of -1 indicates a private item. NOTE: This method is only valid for a local non-versioned file-system.- Specified by:
getCheckoutVersion
in interfaceFolderItem
- Throws:
IOException
-
getLocalCheckoutVersion
public int getLocalCheckoutVersion()Description copied from interface:FolderItem
Returns the local item version at the time the checkout was completed. A value of -1 indicates a private item. NOTE: This method is only valid for a local non-versioned file-system.- Specified by:
getLocalCheckoutVersion
in interfaceFolderItem
-
setCheckout
public void setCheckout(long checkoutId, boolean exclusive, int checkoutVersion, int localVersion) throws IOException Description copied from interface:FolderItem
Set the checkout data associated with this non-shared file. NOTE: This method is only valid for a local non-versioned file-system.- Specified by:
setCheckout
in interfaceFolderItem
- Parameters:
checkoutId
- checkout ID (provided by ItemCheckoutStatus).exclusive
- true if checkout is exclusivecheckoutVersion
- the item version which was checked-out (provided by ItemCheckoutStatus).localVersion
- the local item version at the time the checkout was completed.- Throws:
IOException
- if an IO error occurs or item is stored on a shared file-system
-