/** * Creates a new URL object from a path or a URI string. This is a * convenience wrapper to catch the various conversion exceptions. * * @param pathOrUri * the path or URI string to use. * @return the new URI object for the given path or URI string. */ static public URL toURL(String pathOrUri) { return URItoURL(toURI(pathOrUri)); }
/** * Opens an input stream for filtering * * @param input an input stream to open and filter */ void open(InputStream input) { // Create a temp file for the stream content tempFile = FileUtil.createTempFile("~okapi-23_IDMLFilter_"); StreamUtil.copy(input, tempFile); open(toURI(tempFile.getAbsolutePath())); }
/** * Opens an input stream for filtering * @param input an input stream to open and filter */ public void open (InputStream input) { // // Not supported for this filter // throw new UnsupportedOperationException( // "Method is not supported for this filter.");\ // Create a temp file for the stream content tempFile = FileUtil.createTempFile("~okapi-23_OpenXMLFilter_"); StreamUtil.copy(input, tempFile); open(Util.toURI(tempFile.getAbsolutePath())); }
String pathOrURL = (String) input; File srxFile = new File(Util.toURI(pathOrURL)); if (!srxFile.exists()) throw new OkapiException("SRX file not found");
docURI = Util.toURI(tempFile.getAbsolutePath());