Java Code Examples for org.netbeans.modules.php.api.util.FileUtils#saveFile()

The following examples show how to use org.netbeans.modules.php.api.util.FileUtils#saveFile() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RemoteClient.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private FileLock lockFile(FileObject fo) throws IOException, DownloadSkipException {
    try {
        return fo.lock();
    } catch (FileAlreadyLockedException lockedException) {
        if (warnChangedFile(fo)) {
            FileUtils.saveFile(fo);
            // XXX remove once #213141 is fixed
            try {
                Thread.sleep(1000);
            } catch (InterruptedException ex) {
            }
            return fo.lock();
        } else {
            throw new DownloadSkipException();
        }
    }
}
 
Example 2
Source File: RunFileActionProvider.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void invokeAction(String command, Lookup context) {
    boolean debug = ActionProvider.COMMAND_DEBUG_SINGLE.equals(command);
    for (DataObject dataObject : context.lookupAll(DataObject.class)) {
        File file = FileUtil.toFile(dataObject.getPrimaryFile());
        if (file != null) {
            FileUtils.saveFile(dataObject);
            runFile(file, debug);
        }
    }
}