ProjectRootContainerImpl -> projectModel-impl

This commit is contained in:
Dmitry Jemerov
2012-05-18 19:07:32 +02:00
parent 923b9200a5
commit 74c7b09d3b
3 changed files with 31 additions and 9 deletions
@@ -0,0 +1,23 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.openapi.vfs;
/**
* @author yole
*/
public interface JarCopyingFileSystem {
void setNoCopyJarForPath(String pathInJar);
}
@@ -23,7 +23,7 @@ import org.jetbrains.annotations.Nullable;
import java.io.IOException;
import java.util.zip.ZipFile;
public abstract class JarFileSystem extends NewVirtualFileSystem {
public abstract class JarFileSystem extends NewVirtualFileSystem implements JarCopyingFileSystem {
@NonNls public static final String PROTOCOL = StandardFileSystems.JAR_PROTOCOL;
@NonNls public static final String PROTOCOL_PREFIX = "jar://";
@NonNls public static final String JAR_SEPARATOR = StandardFileSystems.JAR_SEPARATOR;
@@ -36,8 +36,6 @@ public abstract class JarFileSystem extends NewVirtualFileSystem {
public abstract VirtualFile getVirtualFileForJar(@Nullable VirtualFile entryVFile);
public abstract ZipFile getJarFile(VirtualFile entryVFile) throws IOException;
public abstract void setNoCopyJarForPath(String pathInJar);
@SuppressWarnings("MethodMayBeStatic")
@Nullable
public VirtualFile getJarRootForLocalFile(@NotNull VirtualFile virtualFile) {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,9 +27,7 @@ import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.openapi.util.JDOMExternalizable;
import com.intellij.openapi.util.WriteExternalException;
import com.intellij.openapi.vfs.JarFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.openapi.vfs.*;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.HashMap;
import org.jdom.Element;
@@ -194,9 +192,12 @@ public class ProjectRootContainerImpl implements JDOMExternalizable, ProjectRoot
private static void setNoCopyJars(ProjectRoot root){
if (root instanceof SimpleProjectRoot){
String url = ((SimpleProjectRoot)root).getUrl();
if (JarFileSystem.PROTOCOL.equals(VirtualFileManager.extractProtocol(url))){
if (StandardFileSystems.JAR_PROTOCOL.equals(VirtualFileManager.extractProtocol(url))){
String path = VirtualFileManager.extractPath(url);
JarFileSystem.getInstance().setNoCopyJarForPath(path);
final VirtualFileSystem fileSystem = StandardFileSystems.jar();
if (fileSystem instanceof JarCopyingFileSystem) {
((JarCopyingFileSystem)fileSystem).setNoCopyJarForPath(path);
}
}
}
else if (root instanceof CompositeProjectRoot){