Tabnine Logo
FileUtil
Code IndexAdd Tabnine to your IDE (free)

How to use
FileUtil
in
jetbrains.buildServer.util

Best Java code snippets using jetbrains.buildServer.util.FileUtil (Showing top 5 results out of 315)

origin: JetBrains/teamcity-s3-artifact-storage-plugin

public static String normalizeArtifactPath(final String path, final File file) {
 if (StringUtil.isEmpty(path)) {
  return file.getName();
 } else {
  return FileUtil.normalizeRelativePath(String.format("%s/%s", path, file.getName()));
 }
}
origin: PeteGoo/tcSlackBuildNotifier

public void run()
  FileUtil.processXmlFile(SlackNotificationMainConfig.this.myConfigFile, new FileUtil.Processor() {
    public void process(Element rootElement) {
      rootElement.setAttribute("enabled", Boolean.toString(SlackNotificationMainConfig.this.enabled));
origin: milgner/TeamCityRedmine

 private IssueData parseIssue(final InputStream _xml) {
  try {
   Element issue = FileUtil.parseDocument(_xml, false);
   String summary = getChildContent(issue, "subject");
   String state = getAttribute(issue.getChild("status"), "name");
   String url = getUrl(host, id);
   boolean resolved = state.equalsIgnoreCase("Closed") || getChildContent(issue, "done_ratio").equals("100");
   IssueData result = new IssueData(id, summary, state, url, resolved);
   return result;
  } catch (JDOMException e) {
   throw new RuntimeException(String.format("Error parsing XML for issue '%s' on '%s'.", id, host));
  } catch (IOException e) {
   throw new RuntimeException(String.format("Error reading XML for issue '%s' on '%s'.", id, host));
  }
 }
}
origin: PeteGoo/tcSlackBuildNotifier

private void reloadConfiguration() {
  Loggers.ACTIVITIES.info("Loading configuration file: " + this.myConfigFile.getAbsolutePath());
  myConfigDir.mkdirs();
  FileUtil.copyResourceIfNotExists(getClass(), "/config_templates/slack-config.xml", new File(this.myConfigDir, "slack-config.xml"));
  Document document = parseFile(this.myConfigFile);
  if (document != null)
  {
    Element rootElement = document.getRootElement();
    readConfigurationFromXmlElement(rootElement);
  }
}
origin: andreizhuk/tc-ansible-runner

private String getCustomScriptExecutable(AnsibleRunConfig config) throws RunBuildException {
  String content = null;
  File scriptFile = null;
  if (config.getSourceCode() != null) {
    content = config.getSourceCode().replace("\r\n", "\n").replace("\r", "\n");
  }
  if (StringUtil.isEmptyOrSpaces(content)) {
    throw new RunBuildException("Custom script source code cannot be empty");
  }
  try {
    scriptFile = File.createTempFile("ansible_custom_exe", null, getBuildTempDirectory());
    FileUtil.writeFileAndReportErrors(scriptFile, content);
  } catch (IOException e) {
    throw new RunBuildException("Failed to create a tmp file for custom ansible execution script");
  }
  boolean executable = scriptFile.setExecutable(true, true);
  if (!executable) {
    throw new RunBuildException("Failed to set executable permissions to " + scriptFile.getAbsolutePath());
  }
  return scriptFile.getAbsolutePath();
}
jetbrains.buildServer.utilFileUtil

Most used methods

  • copyResourceIfNotExists
  • normalizeRelativePath
  • parseDocument
  • processXmlFile
  • writeFileAndReportErrors

Popular in Java

  • Updating database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • setScale (BigDecimal)
  • requestLocationUpdates (LocationManager)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Reference (javax.naming)
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now