Tabnine Logo
IO.collect
Code IndexAdd Tabnine to your IDE (free)

How to use
collect
method
in
aQute.lib.io.IO

Best Java code snippets using aQute.lib.io.IO.collect (Showing top 20 results out of 315)

origin: biz.aQute.bnd/biz.aQute.bndlib

private static String getMessage(HttpURLConnection conn) {
  try (InputStream in = conn.getErrorStream()) {
    if (in != null)
      return IO.collect(in);
  } catch (Exception e) {
    // Ignore
  }
  return "";
}
origin: biz.aQute.bnd/biz.aQute.repository

String readSHAFile() throws IOException {
  String result;
  if (shaFile != null && shaFile.isFile())
    result = IO.collect(shaFile);
  else
    result = null;
  return result;
}
origin: biz.aQute.bnd/biz.aQute.bnd

String readSHAFile() throws IOException {
  String result;
  if (shaFile != null && shaFile.isFile())
    result = IO.collect(shaFile);
  else
    result = null;
  return result;
}
origin: biz.aQute.bnd/biz.aQute.bndlib

private Version getVersion(File source, Pattern pattern) throws IOException {
  if (!source.isFile())
    return null;
  String content = IO.collect(source);
  Matcher m = pattern.matcher(content);
  if (!m.find())
    return null;
  return new Version(m.group(1));
}
origin: biz.aQute.bnd/bndlib

@Override
public void load(Reader r) throws IOException {
  String s = doBackslashEncoding(IO.collect(r));
  super.load(new StringReader(s));
}
origin: biz.aQute.bnd/bnd

@Override
public void load(Reader r) throws IOException {
  String s = doBackslashEncoding(IO.collect(r));
  super.load(new StringReader(s));
}
origin: biz.aQute.bnd/biz.aQute.bnd

private Version getVersion(File source, Pattern pattern) throws IOException {
  if (!source.isFile())
    return null;
  String content = IO.collect(source);
  Matcher m = pattern.matcher(content);
  if (!m.find())
    return null;
  return new Version(m.group(1));
}
origin: biz.aQute.bnd/bndlib

public static FileLine findHeader(File f, Pattern header) throws IOException {
  String s = IO.collect(f);
  Matcher matcher = header.matcher(s);
  if (!matcher.find())
    return null;
  return new FileLine(f, getLine(s, matcher.start(0)), matcher.group().length());
}
origin: biz.aQute.bnd/bnd

public static FileLine findHeader(File f, Pattern header) throws IOException {
  String s = IO.collect(f);
  Matcher matcher = header.matcher(s);
  if (!matcher.find())
    return null;
  return new FileLine(f, getLine(s, matcher.start(0)), matcher.group().length());
}
origin: biz.aQute.bnd/biz.aQute.bndlib

private boolean replace(File target, final Version newVersion, Pattern pattern) throws IOException {
  String content = IO.collect(target);
  Matcher m = pattern.matcher(content);
  if (!m.find()) {
    return false;
  }
  Version oldVersion = new Version(m.group(1));
  if (newVersion.compareTo(oldVersion) == 0) {
    return true;
  }
  return replace(newVersion, content, m, target);
}
origin: biz.aQute.bnd/biz.aQute.bnd

private boolean replace(File target, final Version newVersion, Pattern pattern) throws IOException {
  String content = IO.collect(target);
  Matcher m = pattern.matcher(content);
  if (!m.find()) {
    return false;
  }
  Version oldVersion = new Version(m.group(1));
  if (newVersion.compareTo(oldVersion) == 0) {
    return true;
  }
  return replace(newVersion, content, m, target);
}
origin: biz.aQute.bnd/biz.aQute.bndlib

@Override
public void load(Reader r) throws IOException {
  String source = IO.collect(new NonClosingReader(r));
  load(source, null, null, null);
}
origin: biz.aQute.bnd/biz.aQute.bnd

@Override
public void load(Reader r) throws IOException {
  String source = IO.collect(new NonClosingReader(r));
  load(source, null, null, null);
}
origin: biz.aQute.bnd/biz.aQute.repository

@Override
public void load(Reader r) throws IOException {
  String source = IO.collect(new NonClosingReader(r));
  load(source, null, null, null);
}
origin: biz.aQute.bnd/biz.aQute.resolve

@Override
public void load(Reader r) throws IOException {
  String source = IO.collect(new NonClosingReader(r));
  load(source, null, null, null);
}
origin: biz.aQute.bnd/biz.aQute.bndlib

@Override
public void delete(Project p) throws IOException {
  File root = p.getWorkspace()
    .getFile("pom.xml");
  String rootPom = IO.collect(root);
  if (rootPom.contains(getTag(p))) {
    rootPom = rootPom.replaceAll("\n\\s*" + getTag(p) + "\\s*", "\n");
    IO.store(rootPom, root);
  }
}
origin: biz.aQute.bnd/bnd

@Override
public void delete(Project p) throws IOException {
  File root = p.getWorkspace().getFile("pom.xml");
  String rootPom = IO.collect(root);
  if ( rootPom.contains(getTag(p))) {
    rootPom = rootPom.replaceAll("\n\\s*" + getTag(p) + "\\s*", "\n");
    IO.store(rootPom, root);
  }
  
}
origin: biz.aQute.bnd/bndlib

@Override
public void delete(Project p) throws IOException {
  File root = p.getWorkspace().getFile("pom.xml");
  String rootPom = IO.collect(root);
  if ( rootPom.contains(getTag(p))) {
    rootPom = rootPom.replaceAll("\n\\s*" + getTag(p) + "\\s*", "\n");
    IO.store(rootPom, root);
  }
  
}
origin: biz.aQute.bnd/biz.aQute.bnd

@Override
public void delete(Project p) throws IOException {
  File root = p.getWorkspace()
    .getFile("pom.xml");
  String rootPom = IO.collect(root);
  if (rootPom.contains(getTag(p))) {
    rootPom = rootPom.replaceAll("\n\\s*" + getTag(p) + "\\s*", "\n");
    IO.store(rootPom, root);
  }
}
origin: biz.aQute.bnd/biz.aQute.bndlib

@Override
public void created(Project p) throws IOException {
  Workspace workspace = p.getWorkspace();
  copy("pom.xml", "pom.xml", p);
  File root = workspace.getFile("pom.xml");
  doRoot(p, root);
  String rootPom = IO.collect(root);
  if (!rootPom.contains(getTag(p))) {
    rootPom = rootPom.replaceAll("<!-- DO NOT EDIT MANAGED BY BND MAVEN LIFECYCLE PLUGIN -->\n",
      "$0\n\t\t" + getTag(p) + "\n");
    IO.store(rootPom, root);
  }
}
aQute.lib.ioIOcollect

Popular methods of IO

  • copy
  • getFile
  • deleteWithException
    Deletes the specified path. Folders are recursively deleted. Throws exception if any of the files co
  • reader
  • store
  • writer
  • delete
    Deletes the specified path. Folders are recursively deleted. If file(s) cannot be deleted, no feedba
  • read
  • rename
    Renames from to to replacing the target file if necessary.
  • isSymbolicLink
  • stream
  • traverse
  • stream,
  • traverse,
  • close,
  • createSymbolicLink,
  • createSymbolicLinkOrCopy,
  • createTempFile,
  • decode,
  • mkdirs,
  • normalizePath

Popular in Java

  • Reactive rest calls using spring rest template
  • getResourceAsStream (ClassLoader)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • putExtra (Intent)
  • Path (java.nio.file)
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • JLabel (javax.swing)
  • Top Sublime Text plugins
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