Package ghidra.framework.store.remote
Class RemoteFolderItem
- java.lang.Object
-
- ghidra.framework.store.remote.RemoteFolderItem
-
- All Implemented Interfaces:
FolderItem
- Direct Known Subclasses:
RemoteDatabaseItem
public abstract class RemoteFolderItem extends java.lang.Object implements FolderItem
RemoteFolderItemprovides an abstract FolderItem implementation for an item contained within a remote Repository.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringcontentTypeprotected java.lang.StringitemNameprotected java.lang.StringparentPathprotected RepositoryAdapterrepositoryprotected intversionprotected longversionTime-
Fields inherited from interface ghidra.framework.store.FolderItem
DATABASE_FILE_TYPE, DATAFILE_FILE_TYPE, DEFAULT_CHECKOUT_ID, LATEST_VERSION, UNKNOWN_FILE_TYPE
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ItemCheckoutStatuscheckout(CheckoutType checkoutType, java.lang.String user, java.lang.String projectPath)Checkout this folder item.voidclearCheckout()Clears the checkout data associated with this non-shared file.voiddelete(int ver, java.lang.String user)Deletes the item or a specific version.ItemCheckoutStatusgetCheckout(long checkoutId)Get the checkout status which corresponds to the specified checkout ID.longgetCheckoutId()Returns the checkoutId for this file.ItemCheckoutStatus[]getCheckouts()Get all current checkouts for this item.intgetCheckoutVersion()Returns the item version which was checked-out.java.lang.StringgetContentType()Return The content type name for this item.intgetContentTypeVersion()Returns the version of content type.intgetCurrentVersion()Return the latest/current version.java.lang.StringgetFileID()Return the file ID if one has been established or nullintgetLocalCheckoutVersion()Returns the local item version at the time the checkout was completed.java.lang.StringgetName()Return The display name for this item.java.lang.StringgetParentPath()Returns the path of the parent folder.java.lang.StringgetPathName()Return The concatenation of the pathname and the basename which can be used to uniquely identify a folder item.Version[]getVersions()Returns list of all available versions or null if item is not versioned.booleanisCheckedOut()Returns true if this item is a checked-out copy from a versioned file system.booleanisCheckedOutExclusive()Returns true if this item is a checked-out copy with exclusive access from a versioned file system.booleanisReadOnly()Returns true if item can be overwritten/deleted.booleanisVersioned()Return true if this is a versioned item, else falselonglastModified()Return The time that this item was last modified.RemoteFolderItemrefresh()Returns this instance after refresh or null if item no longer existsjava.lang.StringresetFileID()Assign a new file-ID to this local non-versioned file.voidsetCheckout(long checkoutId, boolean exclusive, int checkoutVersion, int localVersion)Set the checkout data associated with this non-shared file.voidsetContentTypeVersion(int version)Sets the version for the content type.voidsetReadOnly(boolean state)Set the state of the read-only indicator for this non-shared item.voidterminateCheckout(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 Detail
-
parentPath
protected java.lang.String parentPath
-
itemName
protected java.lang.String itemName
-
contentType
protected java.lang.String contentType
-
version
protected int version
-
versionTime
protected long versionTime
-
repository
protected RepositoryAdapter repository
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:FolderItemReturn The display name for this item.- Specified by:
getNamein interfaceFolderItem
-
refresh
public RemoteFolderItem refresh() throws java.io.IOException
Description copied from interface:FolderItemReturns this instance after refresh or null if item no longer exists- Specified by:
refreshin interfaceFolderItem- Throws:
java.io.IOException
-
getFileID
public java.lang.String getFileID() throws java.io.IOExceptionDescription copied from interface:FolderItemReturn the file ID if one has been established or null- Specified by:
getFileIDin interfaceFolderItem- Throws:
java.io.IOException- See Also:
FolderItem.getFileID()
-
resetFileID
public java.lang.String resetFileID()
Description copied from interface:FolderItemAssign 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:
resetFileIDin interfaceFolderItem- Returns:
- new file-ID
- See Also:
FolderItem.resetFileID()
-
getContentType
public java.lang.String getContentType()
Description copied from interface:FolderItemReturn The content type name for this item.- Specified by:
getContentTypein interfaceFolderItem
-
getParentPath
public java.lang.String getParentPath()
Description copied from interface:FolderItemReturns the path of the parent folder.- Specified by:
getParentPathin interfaceFolderItem
-
getPathName
public java.lang.String getPathName()
Description copied from interface:FolderItemReturn The concatenation of the pathname and the basename which can be used to uniquely identify a folder item.- Specified by:
getPathNamein interfaceFolderItem
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:FolderItemReturns true if item can be overwritten/deleted.- Specified by:
isReadOnlyin interfaceFolderItem
-
setReadOnly
public void setReadOnly(boolean state)
Description copied from interface:FolderItemSet the state of the read-only indicator for this non-shared item.- Specified by:
setReadOnlyin interfaceFolderItem- Parameters:
state- read-only state
-
getContentTypeVersion
public int getContentTypeVersion()
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:
getContentTypeVersionin interfaceFolderItem
-
setContentTypeVersion
public void setContentTypeVersion(int version) throws java.io.IOExceptionDescription copied from interface:FolderItemSets the version for the content type. This will change whenever the domain objects are upgraded.- Specified by:
setContentTypeVersionin interfaceFolderItem- Parameters:
version- the new version for the content type.- Throws:
java.io.IOException- if an IO error occurs or item is stored on a shared file-system- See Also:
FolderItem.setContentTypeVersion(int)
-
lastModified
public long lastModified()
Description copied from interface:FolderItemReturn The time that this item was last modified.- Specified by:
lastModifiedin interfaceFolderItem
-
getCurrentVersion
public int getCurrentVersion()
Description copied from interface:FolderItemReturn the latest/current version.- Specified by:
getCurrentVersionin interfaceFolderItem
-
isVersioned
public boolean isVersioned()
Description copied from interface:FolderItemReturn true if this is a versioned item, else false- Specified by:
isVersionedin interfaceFolderItem
-
getVersions
public Version[] getVersions() throws java.io.IOException
Description copied from interface:FolderItemReturns list of all available versions or null if item is not versioned.- Specified by:
getVersionsin interfaceFolderItem- Throws:
java.io.IOException- thrown if an IO error occurs.
-
delete
public void delete(int ver, java.lang.String user) throws java.io.IOExceptionDescription copied from interface:FolderItemDeletes 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:
deletein interfaceFolderItem- Parameters:
ver- specific version to be deleted, or -1 to remove all versions.user- user name- Throws:
java.io.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:FolderItemReturns true if this item is a checked-out copy from a versioned file system.- Specified by:
isCheckedOutin interfaceFolderItem
-
isCheckedOutExclusive
public boolean isCheckedOutExclusive()
Description copied from interface:FolderItemReturns true if this item is a checked-out copy with exclusive access from a versioned file system.- Specified by:
isCheckedOutExclusivein interfaceFolderItem
-
checkout
public ItemCheckoutStatus checkout(CheckoutType checkoutType, java.lang.String user, java.lang.String projectPath) throws java.io.IOException
Description copied from interface:FolderItemCheckout this folder item.- Specified by:
checkoutin 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:
java.io.IOException- if an IO error occurs or this item is not versioned
-
terminateCheckout
public void terminateCheckout(long checkoutId, boolean notify) throws java.io.IOExceptionDescription copied from interface:FolderItemTerminates a checkout. The checkout ID becomes invalid, therefore the associated checkout copy should either be removed or converted to a private file.- Specified by:
terminateCheckoutin interfaceFolderItem- Parameters:
checkoutId- checkout IDnotify- if true item change notification will be sent- Throws:
java.io.IOException- if an IO error occurs or this item is not versioned
-
getCheckout
public ItemCheckoutStatus getCheckout(long checkoutId) throws java.io.IOException
Description copied from interface:FolderItemGet the checkout status which corresponds to the specified checkout ID.- Specified by:
getCheckoutin interfaceFolderItem- Parameters:
checkoutId- checkout ID- Returns:
- checkout status or null if checkout ID not found.
- Throws:
java.io.IOException- if an IO error occurs or this item is not versioned
-
getCheckouts
public ItemCheckoutStatus[] getCheckouts() throws java.io.IOException
Description copied from interface:FolderItemGet all current checkouts for this item.- Specified by:
getCheckoutsin interfaceFolderItem- Returns:
- array of checkouts
- Throws:
java.io.IOException- if an IO error occurs or this item is not versioned
-
clearCheckout
public void clearCheckout() throws java.io.IOExceptionDescription copied from interface:FolderItemClears the checkout data associated with this non-shared file. NOTE: This method is only valid for a local non-versioned file-system.- Specified by:
clearCheckoutin interfaceFolderItem- Throws:
java.io.IOException
-
getCheckoutId
public long getCheckoutId() throws java.io.IOExceptionDescription copied from interface:FolderItemReturns 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:
getCheckoutIdin interfaceFolderItem- Throws:
java.io.IOException- if an IO error occurs
-
getCheckoutVersion
public int getCheckoutVersion() throws java.io.IOExceptionDescription copied from interface:FolderItemReturns 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:
getCheckoutVersionin interfaceFolderItem- Throws:
java.io.IOException
-
getLocalCheckoutVersion
public int getLocalCheckoutVersion()
Description copied from interface:FolderItemReturns 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:
getLocalCheckoutVersionin interfaceFolderItem
-
setCheckout
public void setCheckout(long checkoutId, boolean exclusive, int checkoutVersion, int localVersion) throws java.io.IOExceptionDescription copied from interface:FolderItemSet the checkout data associated with this non-shared file. NOTE: This method is only valid for a local non-versioned file-system.- Specified by:
setCheckoutin 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:
java.io.IOException- if an IO error occurs or item is stored on a shared file-system
-
-