mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
yet another attempt to handle spaces in URLs
This commit is contained in:
@@ -24,6 +24,8 @@ import org.codehaus.groovy.tools.javac.JavaAwareResolveVisitor;
|
||||
import org.codehaus.groovy.tools.javac.JavaStubGenerator;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.security.AccessController;
|
||||
import java.security.PrivilegedAction;
|
||||
@@ -341,10 +343,17 @@ public class GroovycRunner {
|
||||
final Enumeration resources = super.getResources(name);
|
||||
final ArrayList list = Collections.list(resources);
|
||||
for (Iterator iterator = list.iterator(); iterator.hasNext();) {
|
||||
String file = ((URL)iterator.next()).getFile();
|
||||
System.out.println("Enumerated:" + file);
|
||||
if (file.startsWith(finalOutput) || file.startsWith("/" + finalOutput)) {
|
||||
iterator.remove();
|
||||
final URL url = (URL)iterator.next();
|
||||
if ("file".equals(url.getProtocol())) {
|
||||
try {
|
||||
final String file = new File(new URI(url.toString())).getCanonicalPath();
|
||||
System.out.println("Enumerated:" + file);
|
||||
if (file.startsWith(finalOutput) || file.startsWith("/" + finalOutput)) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
catch (URISyntaxException ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return Collections.enumeration(list);
|
||||
|
||||
@@ -71,7 +71,6 @@ import org.jetbrains.plugins.groovy.lang.psi.GroovyFileBase;
|
||||
import org.jetbrains.plugins.groovy.util.GroovyUtils;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.*;
|
||||
|
||||
@@ -304,9 +303,7 @@ public abstract class GroovyCompilerBase implements TranslatingCompiler {
|
||||
printer.println(PathUtil.getLocalPath(outputDir));
|
||||
|
||||
printer.println(GroovycRunner.FINAL_OUTPUTPATH);
|
||||
final URL finalUrl = VfsUtil.convertToURL(finalOutputDir.getUrl());
|
||||
LOG.assertTrue(finalUrl != null, finalOutputDir.getPath());
|
||||
printer.println(finalUrl.getFile());
|
||||
printer.println(FileUtil.toSystemDependentName(finalOutputDir.getPath()));
|
||||
|
||||
|
||||
printer.close();
|
||||
|
||||
Reference in New Issue
Block a user