Class AmaltheaFileHelper


  • public final class AmaltheaFileHelper
    extends Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String INVALID  
    • Method Summary

      All Methods 
      Modifier and Type Method Description
      static String getNamespaceFromFile​(Path inputPath)
      Extract the model namespace of the given input file.
      static String getNamespaceFromModel​(File inputFile)
      Extract the model namespace of the given input file.
      static String getNamespaceFromZip​(Path inputPath)
      Extract the model namespace of the given input file.
      static boolean isZipFile​(File file)
      Check if the given file is a zip archive.
      • Methods inherited from class Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • isZipFile

        public static boolean isZipFile​(File file)
        Check if the given file is a zip archive.
        Parameters:
        file - The File to check.
        Returns:
        true if the given file is a zip archive, false if not.
      • getNamespaceFromModel

        public static String getNamespaceFromModel​(File inputFile)
        Extract the model namespace of the given input file.
        Parameters:
        inputFile - The file for which the model namespace is requested.
        Returns:
        The model namespace of the given input file or invalid if an error occurs on parsing or the model namespace is invalid.
      • getNamespaceFromZip

        public static String getNamespaceFromZip​(Path inputPath)
        Extract the model namespace of the given input file.
        Parameters:
        inputPath - The Path of the model file for which the model namespace is requested.
        Returns:
        The model namespace of the given input file or invalid if an error occurs on parsing or the model namespace is invalid.
      • getNamespaceFromFile

        public static String getNamespaceFromFile​(Path inputPath)
        Extract the model namespace of the given input file.
        Parameters:
        inputPath - The Path of the model file for which the model namespace is requested.
        Returns:
        The model namespace of the given input file or invalid if an error occurs on parsing or the model namespace is invalid.