update copyright
[fedora-idea.git] / xml / openapi / src / com / intellij / javaee / UriUtil.java
blob1e11b9dfed41fe05b71f4172a4be9a1375f4eb36
1 /*
2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @author max
20 package com.intellij.javaee;
22 import com.intellij.openapi.vfs.VfsUtil;
23 import com.intellij.openapi.vfs.VirtualFile;
24 import com.intellij.psi.PsiFileSystemItem;
25 import org.jetbrains.annotations.NotNull;
26 import org.jetbrains.annotations.Nullable;
28 public class UriUtil {
29 private UriUtil() {}
31 /** @see #findRelativeFile(String, com.intellij.psi.PsiFile) */
32 @Deprecated
33 @Nullable
34 public static VirtualFile findRelativeFile(String uri, VirtualFile base) {
35 return VfsUtil.findRelativeFile(ExternalResourceManager.getInstance().getResourceLocation(uri), base);
38 @Nullable
39 public static VirtualFile findRelative(String uri, @NotNull PsiFileSystemItem base) {
40 String location = ExternalResourceManager.getInstance().getResourceLocation(uri, base.getProject());
41 return VfsUtil.findRelativeFile(location, base.getVirtualFile());