/** * Creates a location consisting of a file name, line number and * column number. * * @param fileName The name of the file. May be <code>null</code>, * in which case the location is equivalent to * {@link #UNKNOWN_LOCATION UNKNOWN_LOCATION}. * * @param lineNumber Line number within the file. Use 0 for unknown * positions within a file. * @param columnNumber Column number within the line. */ public Location(String fileName, int lineNumber, int columnNumber) { if (fileName != null && fileName.startsWith("file:")) { this.fileName = FILE_UTILS.fromURI(fileName); } else { this.fileName = fileName; } this.lineNumber = lineNumber; this.columnNumber = columnNumber; }
private String getMessage(SAXParseException e) { String sysID = e.getSystemId(); if (sysID != null) { String name = sysID; if (sysID.startsWith("file:")) { try { name = FILE_UTILS.fromURI(sysID); } catch (Exception ex) { // if this is not a valid file: just use the uri } } int line = e.getLineNumber(); int col = e.getColumnNumber(); return name + (line == -1 ? "" : (":" + line + (col == -1 ? "" : (":" + col)))) + ": " + e.getMessage(); } return e.getMessage(); } }
String path = FILE_UTILS.fromURI(systemId);
String url = systemid; if (url.startsWith("file:")) { url = FileUtils.getFileUtils().fromURI(url);
String fileName = FILE_UTILS.fromURI(url.toString()); if (fileName != null) { log("fileName " + fileName, Project.MSG_DEBUG);
String path = FILE_UTILS.fromURI(systemId);
/** * Compares URLs for equality but takes case-sensitivity into * account when comparing file URLs and ignores the jar specific * part of the URL if present. */ private static boolean urlEquals(final URL u1, final URL u2) { final String url1 = maybeStripJarAndClass(u1); final String url2 = maybeStripJarAndClass(u2); if (url1.startsWith("file:") && url2.startsWith("file:")) { return new File(FILE_UTILS.fromURI(url1)) .equals(new File(FILE_UTILS.fromURI(url2))); } return url1.equals(url2); }
@Override public InputSource resolveEntity(String publicId, String systemId) { InputSource source = super.resolveEntity(publicId, systemId); if (source != null) { String path = getFileUtils().fromURI(source.getSystemId()); if (currentEntityName == null) { currentEntityPath = path; } else { getAntModel().addEntity(currentEntityName, path); currentEntityName = null; } } return source; }
if (normalizedFileName == null) { if (fileName.startsWith(IAntCoreConstants.FILE_PROTOCOL)) { normalizedFileName = getFileUtils().fromURI(fileName); fNormalizedFileNames.put(fileName, normalizedFileName); } else {