Codota Logo
Directory.create
Code IndexAdd Codota to your IDE (free)

How to use
create
method
in
org.sonar.api.resources.Directory

Best Java code snippets using org.sonar.api.resources.Directory.create (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: org.codehaus.sonar/sonar-batch

@Override
public Resource toResource(File file) {
 if (file == null || !file.exists()) {
  return null;
 }
 String relativePath = pathResolver.relativePath(getBasedir(), file);
 if (relativePath == null) {
  return null;
 }
 return file.isFile() ? org.sonar.api.resources.File.create(relativePath) : org.sonar.api.resources.Directory.create(relativePath);
}
origin: org.codehaus.sonar/sonar-plugin-api

/**
 * @since 4.2
 * @deprecated since 5.1 use {@link FileSystem#inputDir(java.io.File)}
 */
@Deprecated
@CheckForNull
public static Directory fromIOFile(java.io.File dir, Project module) {
 String relativePathFromBasedir = new PathResolver().relativePath(module.getBaseDir(), dir);
 if (relativePathFromBasedir != null) {
  return Directory.create(relativePathFromBasedir);
 }
 return null;
}
origin: fabriciocolombo/sonar-delphi

public Directory getDirectory(java.io.File dir, Project module) {
 Directory directory = Directory.fromIOFile(dir, module);
 if (directory == null || directory.getKey() == null) {
  return Directory.create(DEFAULT_PACKAGE_NAME);
 }
 return directory;
}
origin: org.codehaus.sonar/sonar-batch

 @Override
 public Resource getResource(InputPath inputPath) {
  Resource r;
  if (inputPath instanceof InputDir) {
   r = Directory.create(((InputDir) inputPath).relativePath());
  } else if (inputPath instanceof InputFile) {
   r = File.create(((InputFile) inputPath).relativePath());
  } else {
   throw new IllegalArgumentException("Unknow input path type: " + inputPath);
  }
  return getResource(r);
 }
}
origin: org.sonarsource.sonarqube/sonar-batch

 @Override
 public Resource getResource(InputPath inputPath) {
  Resource r;
  if (inputPath instanceof InputDir) {
   r = Directory.create(((InputDir) inputPath).relativePath());
  } else if (inputPath instanceof InputFile) {
   r = File.create(((InputFile) inputPath).relativePath());
  } else {
   throw new IllegalArgumentException("Unknow input path type: " + inputPath);
  }
  return getResource(r);
 }
}
origin: org.codehaus.sonar/sonar-plugin-api

/**
 * Internal use only.
 * @deprecated since 5.1 use {@link FileSystem#inputFile(org.sonar.api.batch.fs.FilePredicate)}
 */
@Deprecated
public static File create(String relativePathFromBasedir) {
 File file = new File();
 String normalizedPath = normalize(relativePathFromBasedir);
 file.setKey(normalizedPath);
 file.setPath(normalizedPath);
 String directoryPath;
 if (normalizedPath != null && normalizedPath.contains(Directory.SEPARATOR)) {
  directoryPath = StringUtils.substringBeforeLast(normalizedPath, Directory.SEPARATOR);
  file.filename = StringUtils.substringAfterLast(normalizedPath, Directory.SEPARATOR);
 } else {
  directoryPath = Directory.SEPARATOR;
  file.filename = normalizedPath;
 }
 file.parent = Directory.create(directoryPath);
 return file;
}
origin: org.codehaus.sonar/sonar-batch

@Override
public void store(Issue issue) {
 Resource r;
 InputPath inputPath = issue.inputPath();
 if (inputPath != null) {
  if (inputPath instanceof InputDir) {
   r = Directory.create(inputPath.relativePath());
  } else {
   r = File.create(inputPath.relativePath());
  }
 } else {
  r = project;
 }
 Issuable issuable = perspectives.as(Issuable.class, r);
 if (issuable == null) {
  return;
 }
 issuable.addIssue(toDefaultIssue(project.getKey(), ComponentKeys.createEffectiveKey(project, r), issue));
}
org.sonar.api.resourcesDirectorycreate

Javadoc

Internal use only.

Popular methods of Directory

  • fromIOFile
  • <init>
  • getKey
  • getPath
  • parseKey
  • relativePathFromSourceDir
    Internal.
  • add
  • closeDirectory
  • delete
  • equals
  • inDirectory
  • normalize
  • inDirectory,
  • normalize,
  • setKey,
  • setPath

Popular in Java

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (ScheduledExecutorService)
  • putExtra (Intent)
  • addToBackStack (FragmentTransaction)
  • Menu (java.awt)
  • Kernel (java.awt.image)
  • BitSet (java.util)
    This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
  • PriorityQueue (java.util)
    An unbounded priority Queue based on a priority heap. The elements of the priority queue are ordered
  • Reference (javax.naming)
  • JCheckBox (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now