Java program to get class path file by name

           

URL resource = myClass.class.getResource("/PmlConfig.xml");          
System.out.println((new File(resource.toURI())).getAbsolutePath()));

Comments

Popular posts from this blog

Spring Elasticsearch Operations

Object oriented programming concepts (OOPs)

Spring Webflux : How to return HTTP 200 response with body when the called service returns HTTP 201 without body with WebClient?