wiki:ProjectFileHandler

Handling Project in Workspace - API provided by ProjectFileHandler class

createProject(String projectName, String description)

  • creates projectEntry, project folder, ".project.xml" file and "project_details.xml" file with default content for the project
  • returns
    • projectEntry or
    • null if projectNameis null (and does not create files or folder)
  • throws FileAlreadyExistsException when project folder with this name and (or) its ".project.xml" file already exists.
  • throws IOException if i/o error happens while writing ".project.xml" file.

loadProject(String projectName)

  • reads ".project.xml" file from the project folder and returns an entry or null if the name was null
  • creates "project_details.xml" file with default values, if this file does not exist
  • returns
    • projectEntry or
    • null if projectName is null
  • throws FileNotFoundException if the project folder or ".project.xml" file is missing
  • throws IOException if one of the existing files could not be read
  • throws UnsupportedVersionException if the content of ".project.xml" file has child elements with version that are no longer supported in current version
  • throws MissingReaderException if some of the entry cannot be read from the current readers

loadPartialProject(String projectName)

  • loads a project entry (closed project without its children) from the .project.xml file, reads it through ProjectFileReader in partialReadMode
  • creates "project_details.xml" file with default values, if this file does not exist
  • throws FileNotFoundException if the project folder or ".project.xml" file is missing
  • throws IOException if one of the existing files could not be read

saveProject(Entry projectEntry)

  • It saves ".project.xml" file and "project_details.xml" file with the entry content and re-writes both the files. It creates "project_details.xml" file with default values, if this file does not exist.
  • throws FileNotFoundException if the project folder or ".project.xml" file is missing
  • throws IOException if i/o error happens while writing ".project.xml" file.

renameEntryInProject(Entry entryToBeRenamed, String newName)

  • renames entry inside the project with the newName and re-writes the ".project.xml" file
  • returns
    • the renamedEntry or
    • null (if either entryToBeRenamed is null or newName is null or Empty)
  • throws FileNotFoundException if the project folder or ".project.xml" file is missing
  • throws IOException if ".project.xml" file could not be read

deleteEntryFromProject(Entry childEntry)

  • It removes the child entry from the project and re-writes the ".project.xml" file
  • throws FileAlreadyExistsException if the project folder or ".project.xml" file is missing
  • throws IOException if ".project.xml" file could not be read

deleteEntryFromProject(String projectName, String entryId)

  • It removes the child entry from the project and re-writes the ".project.xml" file
  • throws FileAlreadyExistsException if the project folder or ".project.xml" file is missing
  • throws IOException if ".project.xml" file could not be read
Last modified 6 years ago Last modified on 10/23/2015 11:41:53 PM