mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-06 15:55:47 +02:00
[337612] Failed to copy the content of a tar file
This commit is contained in:
parent
781f40219e
commit
bac970f24b
1 changed files with 10 additions and 6 deletions
|
@ -69,12 +69,15 @@ import java.io.InputStreamReader;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.io.OutputStreamWriter;
|
import java.io.OutputStreamWriter;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
|
import org.eclipse.core.runtime.Platform;
|
||||||
|
import org.eclipse.osgi.service.datalocation.Location;
|
||||||
import org.eclipse.osgi.util.NLS;
|
import org.eclipse.osgi.util.NLS;
|
||||||
import org.eclipse.rse.internal.services.local.Activator;
|
import org.eclipse.rse.internal.services.local.Activator;
|
||||||
import org.eclipse.rse.internal.services.local.ILocalMessageIds;
|
import org.eclipse.rse.internal.services.local.ILocalMessageIds;
|
||||||
|
@ -1399,12 +1402,13 @@ public class LocalFileService extends AbstractFileService implements ILocalServi
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isTempFile(File resource){
|
private boolean isTempFile(File resource){
|
||||||
String workspaceLocation = System.getProperty("osgi.instance.area");
|
Location instanceLoc = Platform.getInstanceLocation();
|
||||||
if (workspaceLocation != null && workspaceLocation.length() > 0){
|
URL workspaceLocation = instanceLoc.getURL(); // currently, Eclipse doesn't escape URLs
|
||||||
workspaceLocation = workspaceLocation.substring(6).replace('/', File.separatorChar);
|
|
||||||
}
|
String wsLocation = new File(workspaceLocation.getPath()).toURI().toString();
|
||||||
String path = resource.getAbsolutePath();
|
String fileLocation = resource.toURI().toString();
|
||||||
return (path.startsWith(workspaceLocation));
|
|
||||||
|
return fileLocation.startsWith(wsLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue