public static URL urlFromCurrentDir ( ) throws IOException /* MalformedURLException or such */ { /* This seems to work; independent of whether there happens to * be such/file dir or not. */ File parent = new File ( "a" ) . getAbsoluteFile ( ) . getParentFile ( ) ; return toURL ( parent ) ; }
Method that tries to create and return URL that denotes current working directory . Usually used to create a context when one is not explicitly passed .