Class ResourceUtil

java.lang.Object
org.csstudio.swt.widgets.util.ResourceUtil

public class ResourceUtil extends Object
  • Constructor Details

    • ResourceUtil

      public ResourceUtil()
  • Method Details

    • workspacePathToSysPath

      public static IPath workspacePathToSysPath(IPath path)
      Convert workspace path to OS system path.
      Parameters:
      path - the workspace path
      Returns:
      the corresponding system path. null if it is not exist.
    • pathToInputStreamInJob

      public static void pathToInputStreamInJob(String path, AbstractInputStreamRunnable uiTask, String jobName, IJobErrorHandler errorHandler)
      Get inputstream from path. Run in a Job. The uiTask is responsible for closing the inputstream
      Parameters:
      path - the path to load
      uiTask - the task to be executed in UI thread after path is loaded.
      jobName - name of the job
      errorHandler - the handler to handle IO exception.
    • pathToInputStream

      public static InputStream pathToInputStream(String path) throws Exception
      Return the InputStream of the file that is available on the specified path. The caller is responsible for closing inputstream.
      Parameters:
      path - Path in local file system, or a URL (http:, https:, ftp:, file:, platform:)
      Returns:
      The corresponding InputStream. Never null
      Throws:
      Exception