Package org.csstudio.swt.widgets.util
Class ResourceUtil
java.lang.Object
org.csstudio.swt.widgets.util.ResourceUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic InputStreampathToInputStream(String path) Return theInputStreamof the file that is available on the specified path.static voidpathToInputStreamInJob(String path, AbstractInputStreamRunnable uiTask, String jobName, IJobErrorHandler errorHandler) Get inputstream from path.static IPathworkspacePathToSysPath(IPath path) Convert workspace path to OS system path.
-
Constructor Details
-
ResourceUtil
public ResourceUtil()
-
-
Method Details
-
workspacePathToSysPath
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 loaduiTask- the task to be executed in UI thread after path is loaded.jobName- name of the joberrorHandler- the handler to handle IO exception.
-
pathToInputStream
Return theInputStreamof 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. Nevernull - Throws:
Exception
-