All Downloads are FREE. Search and download functionalities are using the official Maven repository.

src.samples.java.ex.CRF_Sample Maven / Gradle / Ivy

Go to download

An auxiliary findbugs.sourceforge.net plugin for java bug detectors that fall outside the narrow scope of detectors to be packaged with the product itself.

The newest version!
package ex;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy