Lines 57-67
Link Here
|
57 |
import org.netbeans.modules.nativeexecution.api.ExecutionEnvironment; |
57 |
import org.netbeans.modules.nativeexecution.api.ExecutionEnvironment; |
58 |
import org.netbeans.modules.dlight.libs.common.InvalidFileObjectSupport; |
58 |
import org.netbeans.modules.dlight.libs.common.InvalidFileObjectSupport; |
59 |
import org.netbeans.modules.nativeexecution.api.util.ConnectionManager; |
59 |
import org.netbeans.modules.nativeexecution.api.util.ConnectionManager; |
|
|
60 |
import org.netbeans.modules.nativeexecution.api.util.ProcessUtils; |
61 |
import org.netbeans.modules.nativeexecution.api.util.ProcessUtils.ExitStatus; |
60 |
import org.netbeans.modules.remote.support.RemoteLogger; |
62 |
import org.netbeans.modules.remote.support.RemoteLogger; |
61 |
import org.openide.filesystems.FileAttributeEvent; |
63 |
import org.openide.filesystems.FileAttributeEvent; |
62 |
import org.openide.filesystems.FileChangeListener; |
64 |
import org.openide.filesystems.FileChangeListener; |
63 |
import org.openide.filesystems.FileLock; |
65 |
import org.openide.filesystems.FileLock; |
64 |
import org.openide.filesystems.FileObject; |
66 |
import org.openide.filesystems.FileObject; |
|
|
67 |
import org.openide.filesystems.FileRenameEvent; |
65 |
import org.openide.util.Exceptions; |
68 |
import org.openide.util.Exceptions; |
66 |
|
69 |
|
67 |
/** |
70 |
/** |
Lines 332-340
Link Here
|
332 |
|
335 |
|
333 |
@Override |
336 |
@Override |
334 |
public void rename(FileLock lock, String name, String ext) throws IOException { |
337 |
public void rename(FileLock lock, String name, String ext) throws IOException { |
335 |
throw new ReadOnlyException(); |
338 |
String newNameExt = (ext == null) ? name : name + '.' + ext; |
|
|
339 |
if (newNameExt.equals(getNameExt())) { |
340 |
return; |
341 |
} |
342 |
ExitStatus ret = ProcessUtils.executeInDir(getParent().getPath(), getExecutionEnvironment(), "mv", getNameExt(), newNameExt); |
343 |
if (!ret.isOK()) { |
344 |
throw new IOException(ret.error); |
345 |
} |
346 |
try { |
347 |
getParent().refreshImpl(false); |
348 |
} catch (ConnectException ex) { |
349 |
throw ex; |
350 |
} catch (InterruptedException ex) { |
351 |
// nothing |
352 |
} catch (CancellationException ex) { |
353 |
// nothing |
354 |
} catch (ExecutionException ex) { |
355 |
throw new IOException("Can not rename " + getPath() + " to " + newNameExt, ex); //NOI18N |
356 |
} |
336 |
} |
357 |
} |
337 |
|
358 |
|
338 |
@Override |
359 |
@Override |
339 |
public Object getAttribute(String attrName) { |
360 |
public Object getAttribute(String attrName) { |
340 |
return getFileSystem().getAttribute(this, attrName); |
361 |
return getFileSystem().getAttribute(this, attrName); |