Code example for URI

Methods: getPath

0
    private TFiles() { 
        // Do not instantiate 
    } 
 
    public static TFile tFile(URI uri) {
        if (uri.getPath() != null) {
            // if the URI has a path, this means it is a real file, use the detection of the path, and not look at the scheme 
            return new TFile(uri.getPath());
        } else { 
            return new TFile(uri);
        } 
    } 
 
    public static void umountQuietly(TFile tFile) {
        try { 
            if (tFile.isArchive() && tFile.getEnclArchive() == null) {
                TFile.umount(tFile);
            } 
        } catch (FsSyncException e) {
            logger.error("Could not umount {}, continuing", tFile);
            logger.debug("Exception was: ", e);