001/*
002 * SonarQube, open source software quality management tool.
003 * Copyright (C) 2008-2014 SonarSource
004 * mailto:contact AT sonarsource DOT com
005 *
006 * SonarQube is free software; you can redistribute it and/or
007 * modify it under the terms of the GNU Lesser General Public
008 * License as published by the Free Software Foundation; either
009 * version 3 of the License, or (at your option) any later version.
010 *
011 * SonarQube is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014 * Lesser General Public License for more details.
015 *
016 * You should have received a copy of the GNU Lesser General Public License
017 * along with this program; if not, write to the Free Software Foundation,
018 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
019 */
020package org.sonar.api.resources;
021
022import com.google.common.annotations.VisibleForTesting;
023
024import java.io.File;
025import java.util.List;
026
027/**
028 * A class that represents a Java class. This class can either be a Test class or source class
029 *
030 * @since 1.10
031 * @deprecated since 4.2 use {@link org.sonar.api.resources.File}. See
032 * http://docs.codehaus.org/display/SONAR/API+Changes for more details
033 */
034@Deprecated
035public class JavaFile extends Resource {
036
037  @VisibleForTesting
038  JavaFile() {
039  }
040
041  public JavaFile(String packageName, String className) {
042    throw unsupported();
043  }
044
045  public JavaFile(String packageKey, String className, boolean unitTest) {
046    throw unsupported();
047  }
048
049  public JavaFile(String deprecatedKey) {
050    throw unsupported();
051  }
052
053  public JavaFile(String deprecatedKey, boolean unitTest) {
054    throw unsupported();
055  }
056
057  @Override
058  public JavaPackage getParent() {
059    throw unsupported();
060  }
061
062  @Override
063  public String getDescription() {
064    throw unsupported();
065  }
066
067  @Override
068  public Language getLanguage() {
069    throw unsupported();
070  }
071
072  @Override
073  public String getName() {
074    throw unsupported();
075  }
076
077  @Override
078  public String getLongName() {
079    throw unsupported();
080  }
081
082  @Override
083  public String getScope() {
084    throw unsupported();
085  }
086
087  @Override
088  public String getQualifier() {
089    throw unsupported();
090  }
091
092  public boolean isUnitTest() {
093    throw unsupported();
094  }
095
096  @Override
097  public boolean matchFilePattern(String antPattern) {
098    throw unsupported();
099  }
100
101  public static JavaFile fromIOFile(File file, Project module, boolean unitTest) {
102    throw unsupported();
103  }
104
105  public static JavaFile fromRelativePath(String relativePath, boolean unitTest) {
106    throw unsupported();
107  }
108
109  public static JavaFile fromIOFile(File file, List<File> sourceDirs, boolean unitTest) {
110    throw unsupported();
111  }
112
113  public static JavaFile fromAbsolutePath(String path, List<File> sourceDirs, boolean unitTest) {
114    throw unsupported();
115  }
116
117  private static UnsupportedOperationException unsupported() {
118    throw new UnsupportedOperationException("Not supported since v4.2. See http://redirect.sonarsource.com/doc/api-changes.html");
119  }
120
121}