Package ca.phon.media

Class MediaLocator

java.lang.Object
ca.phon.media.MediaLocator

public class MediaLocator extends Object
Helper methods for locating and handling paths for media files. Also includes methods for setting up the media include paths.
  • Field Details

    • MEDIA_INCLUDE_PATH_PROP

      public static final String MEDIA_INCLUDE_PATH_PROP
      Media include path property. This value of this property should be a semi-colon separated list of paths in order of search priority.
      See Also:
  • Constructor Details

    • MediaLocator

      public MediaLocator()
  • Method Details

    • setMediaIncludePaths

      public static void setMediaIncludePaths(List<String> paths)
      Set media include path as a list of paths.
      Parameters:
      paths -
      props -
    • getMediaIncludePaths

      public static List<String> getMediaIncludePaths()
    • getMediaIncludePaths

      public static List<String> getMediaIncludePaths(Project project)
      Parameters:
      project -
      Returns:
    • getMediaIncludePaths

      public static List<String> getMediaIncludePaths(Project project, String corpus)
    • findMediaFile

      public static File findMediaFile(Project project, Session session)
      Find media given a project and session.
    • findMediaFile

      public static File findMediaFile(String filename)
      Search for a file in the media include paths.
      Parameters:
      filename -
      Returns:
      the file object for the file or null if not found
    • findMediaFile

      public static File findMediaFile(String filename, Project project, String corpus)
      Search for a file in the media include path. Will look in the project resource directory first if project is not null.
      Parameters:
      filename -
      project - (may be null)
      corpus - (may be null)
      Returns:
      the file object for the file or null if not found
    • findMediaFileRelative

      public static Tuple<File,File> findMediaFileRelative(String filename, Project project, String corpus)