Skip to content
This repository was archived by the owner on Sep 8, 2019. It is now read-only.

Template constructor with String doesn't work on Windows OS with classpath: type #1

Closed
lauvigne opened this issue Aug 22, 2013 · 2 comments

Comments

@lauvigne
Copy link

For information,
net.codestory.http.templating.Template constructor with String doesn't work on Windows OS with classpath: type :

Caused by: java.nio.file.InvalidPathException: Illegal char <:> at index 9: classpath:web\partial
    at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
    at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
    at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
    at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
    at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
    at java.nio.file.Paths.get(Paths.java:84)
    at net.codestory.http.templating.Template.<init>(Template.java:32)

See in sun.nio.fs.WindowsPathParser.normalize :

// Reserved characters for window path name
private static final String reservedChars = "<>:\"|?*";
@lauvigne
Copy link
Author

lauvigne commented Sep 3, 2013

Fixed on my fork with b7e442f and b075955

ClassLoader.getSystemResource("web").getFile()

return /C:/ and sun.nio.fs.WindowsPathParser.parse want C:/

@dgageot dgageot closed this as completed Nov 18, 2013
@dgageot
Copy link
Member

dgageot commented Nov 18, 2013

Latest code doesn't use classpath: anymore

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants