Lines 64-71
Link Here
|
64 |
import javax.swing.SwingUtilities; |
64 |
import javax.swing.SwingUtilities; |
65 |
import org.netbeans.modules.dlight.libs.common.PathUtilities; |
65 |
import org.netbeans.modules.dlight.libs.common.PathUtilities; |
66 |
import org.netbeans.modules.nativeexecution.api.ExecutionEnvironment; |
66 |
import org.netbeans.modules.nativeexecution.api.ExecutionEnvironment; |
|
|
67 |
import org.netbeans.modules.nativeexecution.api.util.CommonTasksSupport; |
67 |
import org.netbeans.modules.nativeexecution.api.util.ConnectionListener; |
68 |
import org.netbeans.modules.nativeexecution.api.util.ConnectionListener; |
68 |
import org.netbeans.modules.nativeexecution.api.util.ConnectionManager; |
69 |
import org.netbeans.modules.nativeexecution.api.util.ConnectionManager; |
|
|
70 |
import org.netbeans.modules.nativeexecution.api.util.ConnectionManager.CancellationException; |
71 |
import org.netbeans.modules.nativeexecution.api.util.HostInfoUtils; |
69 |
import org.netbeans.modules.remote.api.ui.ConnectionNotifier; |
72 |
import org.netbeans.modules.remote.api.ui.ConnectionNotifier; |
70 |
import org.netbeans.modules.remote.spi.FileSystemCacheProvider; |
73 |
import org.netbeans.modules.remote.spi.FileSystemCacheProvider; |
71 |
import org.netbeans.modules.remote.impl.RemoteLogger; |
74 |
import org.netbeans.modules.remote.impl.RemoteLogger; |
Lines 261-266
Link Here
|
261 |
return getRoot().getFileObject(name); |
264 |
return getRoot().getFileObject(name); |
262 |
} |
265 |
} |
263 |
} |
266 |
} |
|
|
267 |
|
268 |
@Override |
269 |
public FileObject getTempFolder() throws IOException { |
270 |
try { |
271 |
String tmpName = HostInfoUtils.getHostInfo(execEnv).getTempDir(); |
272 |
RemoteFileObjectBase tmpDir = findResource(tmpName); |
273 |
if (tmpDir != null && tmpDir.isFolder() && tmpDir.isValid()) { |
274 |
return tmpDir; |
275 |
} |
276 |
} catch (CancellationException ex) { |
277 |
// |
278 |
} |
279 |
throw new IOException("Cannot find temporary folder"); // NOI18N |
280 |
} |
281 |
|
282 |
@Override |
283 |
public FileObject createTempFile(FileObject parent, String prefix, String suffix) throws IOException { |
284 |
if (parent.isFolder() && parent.isValid()) { |
285 |
while(true) { |
286 |
File tmpFile = File.createTempFile(prefix, suffix); |
287 |
String tmpName = tmpFile.getName(); |
288 |
tmpFile.delete(); |
289 |
try { |
290 |
FileObject fo = parent.createData(tmpName); |
291 |
if (fo != null && fo.isData() && fo.isValid()) { |
292 |
return fo; |
293 |
} |
294 |
break; |
295 |
} catch (IOException ex) { |
296 |
FileObject test = parent.getFileObject(tmpName); |
297 |
if (test != null) { |
298 |
continue; |
299 |
} |
300 |
throw ex; |
301 |
} |
302 |
} |
303 |
} |
304 |
throw new IOException("Cannot create temporary file"); // NOI18N |
305 |
} |
264 |
|
306 |
|
265 |
/*package*/ RemoteFileObjectBase findResource(String name, Set<String> antiloop) { |
307 |
/*package*/ RemoteFileObjectBase findResource(String name, Set<String> antiloop) { |
266 |
if (name.isEmpty() || name.equals("/")) { // NOI18N |
308 |
if (name.isEmpty() || name.equals("/")) { // NOI18N |