Skip to content

Commit 9ea6359

Browse files
authored
Merge pull request #845 from Sloeber/issue/#679
Issue #844
2 parents db3ec47 + 2290f4a commit 9ea6359

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

io.sloeber.core/src/io/sloeber/core/managers/Manager.java

+12
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
4242
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream;
4343
import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;
44+
import org.apache.commons.io.FileUtils;
4445
import org.eclipse.core.runtime.IPath;
4546
import org.eclipse.core.runtime.IProgressMonitor;
4647
import org.eclipse.core.runtime.IStatus;
@@ -194,6 +195,13 @@ public static File getLocalFileName(String url) {
194195
Common.log(new Status(IStatus.ERROR, Activator.getId(), "Malformed url " + url, e)); //$NON-NLS-1$
195196
return null;
196197
}
198+
if("file".equals(packageUrl.getProtocol())) { //$NON-NLS-1$
199+
String tst=packageUrl.getFile();
200+
File file=new File(tst);
201+
String localFileName = file.getName();
202+
Path packagePath = Paths.get(ConfigurationPreferences.getInstallationPath().append(localFileName).toString());
203+
return packagePath.toFile();
204+
}
197205
String localFileName = Paths.get(packageUrl.getPath()).getFileName().toString();
198206
Path packagePath = Paths.get(ConfigurationPreferences.getInstallationPath().append(localFileName).toString());
199207
return packagePath.toFile();
@@ -828,6 +836,10 @@ public static void setReady(boolean b) {
828836
*/
829837
@SuppressWarnings("nls")
830838
private static void myCopy(URL url, File localFile, boolean report_error) throws IOException {
839+
if("file".equals(url.getProtocol())) {
840+
FileUtils.copyFile(new File(url.getFile()), localFile);
841+
return;
842+
}
831843
try {
832844
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
833845
conn.setReadTimeout(5000);

0 commit comments

Comments
 (0)