throw new SVGConverterException(ERROR_UNABLE_TO_CREATE_OUTPUT_DIR);
throw new SVGConverterException(ERROR_UNABLE_TO_CREATE_OUTPUT_DIR);
throw new SVGConverterException(ERROR_UNABLE_TO_CREATE_OUTPUT_DIR);
/** * Populates a vector with the set of SVG files from the * srcDir if it is not null and with the sources (files or URLs) * if any. */ protected List computeSources() throws SVGConverterException{ List sources = new ArrayList(); // Check that at least one source has been specified. if (this.sources == null){ throw new SVGConverterException(ERROR_NO_SOURCES_SPECIFIED); } int n = this.sources.size(); for (int i=0; i<n; i++){ String sourceString = (String)(this.sources.get(i)); File file = new File(sourceString); if (file.exists()) { sources.add(new SVGConverterFileSource(file)); } else { String[] fileNRef = getFileNRef(sourceString); file = new File(fileNRef[0]); if (file.exists()){ sources.add(new SVGConverterFileSource(file, fileNRef[1])); } else{ sources.add(new SVGConverterURLSource(sourceString)); } } } return sources; }
throw new SVGConverterException(ERROR_INVALID_URL, new Object[]{url});
throw new SVGConverterException(ERROR_INVALID_URL, new Object[]{url});
throw new SVGConverterException(ERROR_INVALID_URL, new Object[]{url});
/** * Populates a vector with the set of SVG files from the * srcDir if it is not null and with the sources (files or URLs) * if any. */ protected List computeSources() throws SVGConverterException{ List sources = new ArrayList(); // Check that at least one source has been specified. if (this.sources == null){ throw new SVGConverterException(ERROR_NO_SOURCES_SPECIFIED); } int n = this.sources.size(); for (Object source : this.sources) { String sourceString = (String) source; File file = new File(sourceString); if (file.exists()) { sources.add(new SVGConverterFileSource(file)); } else { String[] fileNRef = getFileNRef(sourceString); file = new File(fileNRef[0]); if (file.exists()) { sources.add(new SVGConverterFileSource(file, fileNRef[1])); } else { sources.add(new SVGConverterURLSource(sourceString)); } } } return sources; }
/** * Populates a vector with the set of SVG files from the * srcDir if it is not null and with the sources (files or URLs) * if any. */ protected List computeSources() throws SVGConverterException{ List sources = new ArrayList(); // Check that at least one source has been specified. if (this.sources == null){ throw new SVGConverterException(ERROR_NO_SOURCES_SPECIFIED); } int n = this.sources.size(); for (Object source : this.sources) { String sourceString = (String) source; File file = new File(sourceString); if (file.exists()) { sources.add(new SVGConverterFileSource(file)); } else { String[] fileNRef = getFileNRef(sourceString); file = new File(fileNRef[0]); if (file.exists()) { sources.add(new SVGConverterFileSource(file, fileNRef[1])); } else { sources.add(new SVGConverterURLSource(sourceString)); } } } return sources; }
if (dst != null) { if (dst.exists() && dst.isFile()) { throw new SVGConverterException(ERROR_CANNOT_USE_DST_FILE); SVGConverterSource src = (SVGConverterSource)sources.get(i); if (!(src instanceof SVGConverterFileSource)) { throw new SVGConverterException(ERROR_CANNOT_COMPUTE_DESTINATION, new Object[]{src});
if (dst != null) { if (dst.exists() && dst.isFile()) { throw new SVGConverterException(ERROR_CANNOT_USE_DST_FILE); SVGConverterSource src = (SVGConverterSource) source; if (!(src instanceof SVGConverterFileSource)) { throw new SVGConverterException(ERROR_CANNOT_COMPUTE_DESTINATION, new Object[]{src});
if (dst != null) { if (dst.exists() && dst.isFile()) { throw new SVGConverterException(ERROR_CANNOT_USE_DST_FILE); SVGConverterSource src = (SVGConverterSource) source; if (!(src instanceof SVGConverterFileSource)) { throw new SVGConverterException(ERROR_CANNOT_COMPUTE_DESTINATION, new Object[]{src});
throw new SVGConverterException(ERROR_SOURCE_SAME_AS_DESTINATION, true /* fatal error */); throw new SVGConverterException(ERROR_CANNOT_READ_SOURCE, new Object[]{inputFile.getName()}); in.close(); } catch(IOException ioe) { throw new SVGConverterException(ERROR_CANNOT_OPEN_SOURCE, new Object[] {inputFile.getName(), ioe.toString()}); throw new SVGConverterException(ERROR_OUTPUT_NOT_WRITEABLE, new Object[] {outputFile.getName()}); outputStream = new FileOutputStream(outputFile); } catch(FileNotFoundException fnfe) { throw new SVGConverterException(ERROR_CANNOT_OPEN_OUTPUT_FILE, new Object[] {outputFile.getName()}); throw new SVGConverterException(ERROR_WHILE_RASTERIZING_FILE, new Object[] {outputFile.getName(), te.getMessage()});
throw new SVGConverterException(ERROR_SOURCE_SAME_AS_DESTINATION, true /* fatal error */); throw new SVGConverterException(ERROR_CANNOT_READ_SOURCE, new Object[]{inputFile.getName()}); in.close(); } catch(IOException ioe) { throw new SVGConverterException(ERROR_CANNOT_OPEN_SOURCE, new Object[] {inputFile.getName(), ioe.toString()}); throw new SVGConverterException(ERROR_OUTPUT_NOT_WRITEABLE, new Object[] {outputFile.getName()}); outputStream = new FileOutputStream(outputFile); } catch(FileNotFoundException fnfe) { throw new SVGConverterException(ERROR_CANNOT_OPEN_OUTPUT_FILE, new Object[] {outputFile.getName()}); throw new SVGConverterException(ERROR_WHILE_RASTERIZING_FILE, new Object[] {outputFile.getName(), te.getMessage()});
throw new SVGConverterException(ERROR_SOURCE_SAME_AS_DESTINATION, true /* fatal error */); throw new SVGConverterException(ERROR_CANNOT_READ_SOURCE, new Object[]{inputFile.getName()}); in.close(); } catch(IOException ioe) { throw new SVGConverterException(ERROR_CANNOT_OPEN_SOURCE, new Object[] {inputFile.getName(), ioe.toString()}); throw new SVGConverterException(ERROR_OUTPUT_NOT_WRITEABLE, new Object[] {outputFile.getName()}); outputStream = new FileOutputStream(outputFile); } catch(FileNotFoundException fnfe) { throw new SVGConverterException(ERROR_CANNOT_OPEN_OUTPUT_FILE, new Object[] {outputFile.getName()}); throw new SVGConverterException(ERROR_WHILE_RASTERIZING_FILE, new Object[] {outputFile.getName(), te.getMessage()});
throw new SVGConverterException(ERROR_CANNOT_ACCESS_TRANSCODER, new Object[]{destinationType.toString()}, true /* fatal error */);
throw new SVGConverterException(ERROR_CANNOT_ACCESS_TRANSCODER, new Object[]{destinationType.toString()}, true /* fatal error */);
throw new SVGConverterException(ERROR_CANNOT_ACCESS_TRANSCODER, new Object[]{destinationType.toString()}, true /* fatal error */);