Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 import java.io.File;
 import java.net.URL;
 
 
 public class CRF_Sample {
 
 	public long testFileFromCPURL() throws URISyntaxException {
		URL u = CRF_Sample.class.getResource("/CRF_Sample.class");
		File f = new File(u.toURI());
		return f.length();
	}
	public long testFileFromCPURL2() {
		URL u = CRF_Sample.class.getResource("/CRF_Sample.class");
		File f = new File(u.getFile());
		return f.length();
	}
	public long testFileFromCPURL3()  throws MalformedURLException {
		URL u = new URL("http://www.google.com");
		File f = new File(u.getFile());
		return f.length();
	}
New to GrepCode? Check out our FAQ X