APISonar


org.netbeans.modules.localhistory.LocalHistory.LOG.log

> org > netbeans > modules > localhistory > LocalHistory > LOG > log
org APIs netbeans APIs modules APIs localhistory APIs LocalHistory APIs LOG APIs log APIs

Example 1
private void writeStorage() {
        DataOutputStream dos = null;
        try {
            dos = getOutputStream(new File(storage, STORAGE_FILE), false);
            writeString(dos, STORAGE_VERSION);
            dos.flush();
        } catch (Exception e) {
            LocalHistory.LOG.log(Level.INFO, null, e);
        } finally {
            if (dos != null) {
                try { dos.close(); } catch (IOException e) { }
            }
        }
    }
Example 2
public static String getPath(VCSFileProxy proxy) {
        File file = proxy.toFile();
        if(file != null) {
            // handle as local file
            return file.getAbsolutePath();
        } else {
            try {
                return proxy.toURI().toString();
            } catch (URISyntaxException ex) {
                LocalHistory.LOG.log(Level.WARNING, proxy.getPath(), ex);
                return proxy.getPath();
            }
        }
    }
Example 3
public static VCSFileProxy createProxy(String path) {
        try {
            URI uri = new URI(path);
            String scheme = uri.getScheme();
            if (scheme == null) {
                // handle as local file
                return VCSFileProxy.createFileProxy(new File(path));
            } else {
                return VCSFileProxy.createFileProxy(uri);
            }
        } catch (URISyntaxException ex) {
            LocalHistory.LOG.log(Level.FINE, path, ex);
        }
        return VCSFileProxy.createFileProxy(new File(path));
    }
Example 4
public void fileCreate(VCSFileProxy file, long ts) {
        Semaphore s = lock(file, "fileCreate"); // NOI18N
        try {
            fileCreateImpl(file, ts, null, FileUtils.getPath(file));
        } catch (IOException ioe) {
            LocalHistory.LOG.log(Level.WARNING, null, ioe);
        } finally {
            if(s != null) s.release();
        }
    }
Example 5
public void fileCreateFromMove(VCSFileProxy from, VCSFileProxy to, long ts) {
        Semaphore s = lock(from, "fileCreateFromMove"); // NOI18N
        try {
            if(lastModified(to) > 0) {
                return;
            }
            fileCreateImpl(to, ts, FileUtils.getPath(from), FileUtils.getPath(to));
        } catch (IOException ioe) {
            LocalHistory.LOG.log(Level.WARNING, null, ioe);
        } finally {
            if(s != null) s.release();
        }
        fireChanged(to, ts);
    }