Wilson Net
asked on
URL.getPath return wrong file path in linux
I have a Web App in Java running in ubuntu 18.04 and I need to make a URL to the wildfly path to use in a custom file writter.
I use the following code to create the URL object
but when i use that object show me a File not found error, and when i do
it show: /wildfly/standalone/deploy ment/temp. locale
why the URL object is removen the /opt/ from the path?
this only happen in linux, if i change the file path to windows it work fine.
I use the following code to create the URL object
URL rutaWildfly = new URL("file://opt/wildfly/standalone/deployment/temp.locale");
but when i use that object show me a File not found error, and when i do
System.out.println(rutaWildfly.getPath());
it show: /wildfly/standalone/deploy
why the URL object is removen the /opt/ from the path?
this only happen in linux, if i change the file path to windows it work fine.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
:)
ASKER