Class ProjectOperations

java.lang.Object
org.netbeans.spi.project.support.ProjectOperations

public final class ProjectOperations extends Object
Allows gathering information for various project operations.
Since:
1.7
  • Method Details

    • getMetadataFiles

      public static List<org.openide.filesystems.FileObject> getMetadataFiles(Project prj)
      Return list of files that are considered metadata files and folders for the given project. Returns meaningful values only if some of the is*Supported methods return true.
      Parameters:
      prj - project to test
      Returns:
      list of metadata files/folders
      See Also:
    • getDataFiles

      public static List<org.openide.filesystems.FileObject> getDataFiles(Project prj)
      Return list of files that are considered source files and folders for the given project. Returns meaningful values only if some of the is*Supported methods return true.
      Parameters:
      prj - project to test
      Returns:
      list of data files/folders
      See Also:
    • isDeleteOperationSupported

      public static boolean isDeleteOperationSupported(Project prj)
      Test whether the delete operation is supported on the given project.
      Parameters:
      prj - project to test
      Returns:
      true if the project has a DeleteOperationImplementation, false otherwise
    • notifyDeleting

      public static void notifyDeleting(Project prj) throws IOException
      Notification that the project is about to be deleted. Should be called immediately before the project is deleted. The project is supposed to do all required cleanup to allow the project to be deleted.
      Parameters:
      prj - project to notify
      Throws:
      IOException - is some error occurs
      See Also:
    • notifyDeleted

      public static void notifyDeleted(Project prj) throws IOException
      Notification that the project has been deleted. Should be called immediately after the project is deleted.
      Parameters:
      prj - project to notify
      Throws:
      IOException - is some error occurs
      See Also:
    • isCopyOperationSupported

      public static boolean isCopyOperationSupported(Project prj)
      Test whether the copy operation is supported on the given project.
      Parameters:
      prj - project to test
      Returns:
      true if the project has a CopyOperationImplementation, false otherwise
    • notifyCopying

      public static void notifyCopying(Project prj) throws IOException
      Notification that the project is about to be copyied. Should be called immediatelly before the project is copied. The project is supposed to do all required cleanup to allow the project to be copied.
      Parameters:
      prj - project to notify
      Throws:
      IOException - is some error occurs
      See Also:
    • notifyCopied

      public static void notifyCopied(Project original, Project nue, File originalPath, String name) throws IOException
      Notification that the project has been copied. Should be called immediatelly after the project is copied. The project is supposed to do all necessary fixes to the project's structure to form a valid project. Both original and newly created project (copy) are notified, in this order.
      Parameters:
      original - original project
      nue - new project (copy)
      originalPath - the project folder of the original project (for consistency with notifyMoved)
      name - new name of the project
      Throws:
      IOException - is some error occurs
      See Also:
    • notifyMoving

      public static void notifyMoving(Project prj) throws IOException
      Notification that the project is about to be moved. Should be called immediately before the project is moved. MoveOrRenameOperationImplementation.notifyRenaming() may be called instead. The project is supposed to do all required cleanup to allow the project to be moved.
      Parameters:
      prj - project to notify
      Throws:
      IOException - is some error occurs
      See Also:
    • notifyMoved

      public static void notifyMoved(Project original, Project nue, File originalPath, String name) throws IOException
      Notification that the project has been moved. Should be called immediatelly after the project is moved. MoveOrRenameOperationImplementation.notifyRenamed(java.lang.String) may be called instead. The project is supposed to do all necessary fixes to the project's structure to form a valid project. Both original and moved project are notified, in this order.
      Parameters:
      original - original project
      nue - moved project
      originalPath - the project folder of the original project
      name - new name of the project
      Throws:
      IOException - is some error occurs
      See Also:
    • isMoveOperationSupported

      public static boolean isMoveOperationSupported(Project prj)
      Tests whether the move or rename operations are supported on the given project.
      Parameters:
      prj - project to test
      Returns:
      true if the project has a MoveOperationImplementation, false otherwise