copyright: update license
[fedora-idea.git] / plugins / Copyright / src / com / maddyhome / idea / copyright / util / FileUtil.java
blob51daba7a695cad1a3d0b01b25da44e1a9df522df
1 /*
2 * Copyright 2000-2007 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.
17 package com.maddyhome.idea.copyright.util;
19 import com.intellij.openapi.project.Project;
20 import com.intellij.openapi.vfs.VirtualFile;
21 import com.intellij.psi.PsiFile;
22 import com.intellij.psi.PsiManager;
24 public class FileUtil
26 public static boolean areFiles(VirtualFile[] files)
28 if (files == null || files.length < 2)
30 return false;
33 for (VirtualFile file : files)
35 if (file.isDirectory())
37 return false;
41 return true;
44 public static PsiFile[] convertToPsiFiles(VirtualFile[] files, Project project)
46 PsiFile[] res = new PsiFile[files.length];
47 PsiManager manager = PsiManager.getInstance(project);
48 for (int i = 0; i < files.length; i++)
50 res[i] = manager.findFile(files[i]);
53 return res;
56 private FileUtil()