Skip to content

Commit

Permalink
replace obsolete code by modern one
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
  • Loading branch information
lukasj committed Oct 19, 2023
1 parent 1b4ab3a commit 5e9132f
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions dtd-parser/src/main/java/com/sun/xml/dtdparser/Resolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -261,22 +261,8 @@ public static InputSource createInputSource(URL uri, boolean checkType)
*/
public static InputSource createInputSource(File file)
throws IOException {
InputSource retval;
String path;

retval = new InputSource(XmlReader.createReader(new FileInputStream(file)));

// On JDK 1.2 and later, simplify this:
// "path = file.toURL ().toString ()".
path = file.getAbsolutePath();
if (File.separatorChar != '/')
path = path.replace(File.separatorChar, '/');
if (!path.startsWith("/"))
path = "/" + path;
if (!path.endsWith("/") && file.isDirectory())
path = path + "/";

retval.setSystemId("file:" + path);
InputSource retval = new InputSource(XmlReader.createReader(new FileInputStream(file)));
retval.setSystemId(file.toURI().toURL().toString());
return retval;
}

Expand Down

0 comments on commit 5e9132f

Please sign in to comment.