Package ghidra.framework.model
Class TestDummyProjectData
- java.lang.Object
 - 
- ghidra.framework.model.TestDummyProjectData
 
 
- 
- All Implemented Interfaces:
 ProjectData
public class TestDummyProjectData extends java.lang.Object implements ProjectData
 
- 
- 
Constructor Summary
Constructors Constructor Description TestDummyProjectData() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDomainFolderChangeListener(DomainFolderChangeListener listener)Adds a listener that will be notified when any folder or file changes in the project.voidclose()Close the project storage associated with this project data object.voidconvertProjectToShared(RepositoryAdapter repository, TaskMonitor monitor)Convert a local project to a shared project.voidfindOpenFiles(java.util.List<DomainFile> list)Finds all open domain files and appends them to the specified list.DomainFilegetFile(java.lang.String path)Get domain file specified by an absolute data path.DomainFilegetFileByID(java.lang.String fileID)Get domain file specified by its unique fileID.intgetFileCount()Get the approximate number of files contained within the project.DomainFoldergetFolder(java.lang.String path)Get domain folder specified by an absolute data path.java.lang.Class<? extends LocalFileSystem>getLocalStorageClass()intgetMaxNameLength()ProjectLocatorgetProjectLocator()Returns the projectLocator for the this ProjectData.RepositoryAdaptergetRepository()Return the repository for this project data.DomainFoldergetRootFolder()Returns the root folder of the project.java.net.URLgetSharedFileURL(java.lang.String path)Get a GhidraURL for a shared domain file which is available within a remote repository.UsergetUser()Returns User object associated with remote repository or null if a remote repository is not used.java.lang.StringmakeValidName(java.lang.String name)Transform the specified name into an acceptable folder or file item name.voidrefresh(boolean force)Sync the Domain folder/file structure with the underlying file structure.voidremoveDomainFolderChangeListener(DomainFolderChangeListener listener)Removes the listener to be notified of folder and file changes.voidtestValidName(java.lang.String name, boolean isPath)Validate a folder/item name or path.voidupdateRepositoryInfo(RepositoryAdapter repository, TaskMonitor monitor)Update the repository for this project; the server may have changed or a different repository is being used. 
 - 
 
- 
- 
Method Detail
- 
getLocalStorageClass
public java.lang.Class<? extends LocalFileSystem> getLocalStorageClass()
- Specified by:
 getLocalStorageClassin interfaceProjectData- Returns:
 - local storage implementation class
 
 
- 
getRootFolder
public DomainFolder getRootFolder()
Description copied from interface:ProjectDataReturns the root folder of the project.- Specified by:
 getRootFolderin interfaceProjectData
 
- 
getFolder
public DomainFolder getFolder(java.lang.String path)
Description copied from interface:ProjectDataGet domain folder specified by an absolute data path.- Specified by:
 getFolderin interfaceProjectData- Parameters:
 path- the absolute path of domain folder relative to the data folder.- Returns:
 - domain folder or null if folder not found
 
 
- 
getFileCount
public int getFileCount()
Description copied from interface:ProjectDataGet the approximate number of files contained within the project. The number may be reduced if not connected to the shared repository. Only the newer indexed file-system supports this capability, a value of -1 will be returned for older projects utilizing the mangled file-system or if an IO Error occurs. An approximate number is provided since the two underlying file systems are consulted separately and the local private file-system does not distinguish between checked-out files and private files. This number is currently intended as a rough sizing number to disable certain features when very large projects are in use. Generally the larger of the two file counts will be returned.- Specified by:
 getFileCountin interfaceProjectData- Returns:
 - number of project files or -1 if unknown.
 
 
- 
getFile
public DomainFile getFile(java.lang.String path)
Description copied from interface:ProjectDataGet domain file specified by an absolute data path.- Specified by:
 getFilein interfaceProjectData- Parameters:
 path- the absolute path of domain file relative to the root folder.- Returns:
 - domain file or null if file not found
 
 
- 
findOpenFiles
public void findOpenFiles(java.util.List<DomainFile> list)
Description copied from interface:ProjectDataFinds all open domain files and appends them to the specified list.- Specified by:
 findOpenFilesin interfaceProjectData- Parameters:
 list- the list to receive the open domain files
 
- 
getFileByID
public DomainFile getFileByID(java.lang.String fileID)
Description copied from interface:ProjectDataGet domain file specified by its unique fileID.- Specified by:
 getFileByIDin interfaceProjectData- Parameters:
 fileID- domain file ID- Returns:
 - domain file or null if file not found
 
 
- 
getSharedFileURL
public java.net.URL getSharedFileURL(java.lang.String path)
Description copied from interface:ProjectDataGet a GhidraURL for a shared domain file which is available within a remote repository.- Specified by:
 getSharedFileURLin interfaceProjectData- Parameters:
 path- the absolute path of domain file relative to the root folder.- Returns:
 - URL object for accessing shared file from outside of a project, or null if file does not exist or is not shared.
 - See Also:
 ghidra.framework.data.URLGhidraRepository
 
- 
makeValidName
public java.lang.String makeValidName(java.lang.String name)
Description copied from interface:ProjectDataTransform the specified name into an acceptable folder or file item name. Only an individual folder or file name should be specified, since any separators will be stripped-out. NOTE: Uniqueness of name within the intended target folder is not considered.- Specified by:
 makeValidNamein interfaceProjectData- Returns:
 - valid name or "unknown" if no valid characters exist within name provided
 
 
- 
getProjectLocator
public ProjectLocator getProjectLocator()
Description copied from interface:ProjectDataReturns the projectLocator for the this ProjectData.- Specified by:
 getProjectLocatorin interfaceProjectData
 
- 
addDomainFolderChangeListener
public void addDomainFolderChangeListener(DomainFolderChangeListener listener)
Description copied from interface:ProjectDataAdds a listener that will be notified when any folder or file changes in the project.- Specified by:
 addDomainFolderChangeListenerin interfaceProjectData- Parameters:
 listener- the listener to be notified of folder and file changes.
 
- 
removeDomainFolderChangeListener
public void removeDomainFolderChangeListener(DomainFolderChangeListener listener)
Description copied from interface:ProjectDataRemoves the listener to be notified of folder and file changes.- Specified by:
 removeDomainFolderChangeListenerin interfaceProjectData- Parameters:
 listener- the listener to be removed.
 
- 
refresh
public void refresh(boolean force) throws java.io.IOExceptionDescription copied from interface:ProjectDataSync the Domain folder/file structure with the underlying file structure.- Specified by:
 refreshin interfaceProjectData- Parameters:
 force- if true all folders will be be visited and refreshed, if false only those folders previously visited will be refreshed.- Throws:
 java.io.IOException
 
- 
getUser
public User getUser()
Description copied from interface:ProjectDataReturns User object associated with remote repository or null if a remote repository is not used.- Specified by:
 getUserin interfaceProjectData
 
- 
getRepository
public RepositoryAdapter getRepository()
Description copied from interface:ProjectDataReturn the repository for this project data.- Specified by:
 getRepositoryin interfaceProjectData- Returns:
 - null if the project is not associated with a repository
 
 
- 
convertProjectToShared
public void convertProjectToShared(RepositoryAdapter repository, TaskMonitor monitor) throws java.io.IOException, CancelledException
Description copied from interface:ProjectDataConvert a local project to a shared project. NOTE: The project should be closed and then reopened after this method is called.- Specified by:
 convertProjectToSharedin interfaceProjectData- Parameters:
 repository- the repository that the project will be associated with.monitor- task monitor- Throws:
 java.io.IOException- thrown if files under version control are still checked out, or if there was a problem accessing the filesystemCancelledException- if the conversion was cancelled while versioned files were being converted to private files.
 
- 
updateRepositoryInfo
public void updateRepositoryInfo(RepositoryAdapter repository, TaskMonitor monitor) throws java.io.IOException, CancelledException
Description copied from interface:ProjectDataUpdate the repository for this project; the server may have changed or a different repository is being used. NOTE: The project should be closed and then reopened after this method is called.- Specified by:
 updateRepositoryInfoin interfaceProjectData- Parameters:
 repository- new repository to usemonitor- task monitor- Throws:
 java.io.IOException- thrown if files are still checked out, or if there was a problem accessing the filesystemCancelledException- if the user canceled the update
 
- 
close
public void close()
Description copied from interface:ProjectDataClose the project storage associated with this project data object. NOTE: This should not be invoked if this object is utilized by a Project instance.- Specified by:
 closein interfaceProjectData
 
- 
getMaxNameLength
public int getMaxNameLength()
- Specified by:
 getMaxNameLengthin interfaceProjectData
 
- 
testValidName
public void testValidName(java.lang.String name, boolean isPath) throws InvalidNameExceptionDescription copied from interface:ProjectDataValidate a folder/item name or path.- Specified by:
 testValidNamein interfaceProjectData- Parameters:
 name- folder or item nameisPath- if true name represents full path- Throws:
 InvalidNameException- if name is invalid
 
 - 
 
 -