Class DtFileSystemUtil


  • public final class DtFileSystemUtil
    extends Object
    DT file system utitilies.
    • Method Detail

      • createDtFileUri

        public static URI createDtFileUri​(String projectName,
                                          String filePath)
        Creates a DT file URI.
        Parameters:
        projectName -
        filePath -
        Returns:
      • isDtFileUri

        public static boolean isDtFileUri​(URI uri)
        Checks if the given URI is a DT URI.
        Parameters:
        uri -
        Returns:
      • extractProjectName

        public static String extractProjectName​(URI uri)
        Extracts the project name from the given URI.
        Parameters:
        uri -
        Returns:
      • extractFilePath

        public static String extractFilePath​(URI uri)
        Extracts the file path from the given URI.
        Parameters:
        uri -
        Returns:
      • isDeletionMarker

        public static boolean isDeletionMarker​(Path path)
                                        throws IOException
        Checks if the specified file is a deletion marker.
        Parameters:
        path -
        Returns:
        Throws:
        IOException
      • isDeletionMarker

        public static boolean isDeletionMarker​(InputStream inputStream)
                                        throws IOException
        Checks if the specified input stream is a deletion marker.
        Parameters:
        inputStream - the input stream to check, cannot be null
        Returns:
        true if the specified input strean is a deletion marker, false otherwise
        Throws:
        IOException - if an I/O error has occurred
      • createDeletionMarker

        public static void createDeletionMarker​(Path path)
                                         throws IOException
        Creates a deletion marker.
        Parameters:
        path -
        Throws:
        IOException
      • getResourcePath

        public static Path getResourcePath​(org.eclipse.core.resources.IResource resource)
                                    throws org.eclipse.core.runtime.CoreException
        Get Path by IResource
        Parameters:
        resource - the IResource, cannot be null
        Returns:
        resource path, can be null
        Throws:
        org.eclipse.core.runtime.CoreException