Tabnine Logo
org.apache.karaf.util
Code IndexAdd Tabnine to your IDE (free)

How to use org.apache.karaf.util

Best Java code snippets using org.apache.karaf.util (Showing top 20 results out of 513)

origin: apache/karaf

protected Document parse(File artifact) throws Exception {
  return XmlUtils.parse(artifact, new ErrorHandler() {
    public void warning(SAXParseException exception) throws SAXException {
    }
    public void error(SAXParseException exception) throws SAXException {
    }
    public void fatalError(SAXParseException exception) throws SAXException {
      throw exception;
    }
  });
}
origin: apache/karaf

/**
 * Constructs threads with names <code>&lt;prefix&gt;-&lt;pool number&gt;-thread-&lt;thread number&gt;</code>.
 * @param prefix prefix to be used for thread names created by this {@link ThreadFactory}
 * @return
 */
public static ThreadFactory namedThreadFactory(String prefix) {
  return new NamedThreadFactory(prefix);
}
origin: apache/karaf

/**
 * Short-hand builder configuration to use standard Karaf static KAR at current Karaf version
 * @return
 */
public Builder staticFramework() {
  return staticFramework(Version.karafVersion());
}
origin: apache/karaf

private void copyBinaryResourceToDir(String resource, File target, Map<String, URL> resources, boolean printOutput) throws IOException {
  File outFile = new File(target, resource);
  if( !outFile.exists() ) {
    logDebug("Creating file: %s", printOutput, outFile.getPath());
    try (
      InputStream is = getResourceStream(resource, resources);
      OutputStream os = new FileOutputStream(outFile)
    ) {
      StreamUtils.copy(is, os);
    }
  }
}
origin: apache/karaf

public URL transform(URL artifact) throws Exception {
  try
  {
    String path = artifact.getPath();
    String name = path.substring( path.lastIndexOf('/') + 1);
    String[] nv = DeployerUtils.extractNameVersionType( name );
    return new URL("wrap", null, artifact.toExternalForm() + "$Bundle-SymbolicName=" + nv[0] + "&Bundle-Version=" + nv[1]);
  } catch (Exception e) {
    return new URL("wrap", null, artifact.toExternalForm());
  }
}
origin: apache/karaf

public AutoEncryptionSupport(Map<String, Object> properties) {
  running = true;
  encryptionSupport = new EncryptionSupport(properties);
  executor = Executors.newSingleThreadExecutor(ThreadUtils.namedThreadFactory("encryption"));
  executor.execute(this);
}
origin: apache/karaf

public static Document parse(File f, ErrorHandler errorHandler) throws TransformerException, IOException, SAXException, ParserConfigurationException {
  DocumentBuilder db = documentBuilder();
  db.setErrorHandler(errorHandler);
  try {
    return db.parse(f);
  } finally {
    db.reset();
  }
}
origin: apache/karaf

public static void transform(Source xmlSource, Result outputTarget) throws TransformerException {
  Transformer t = transformer();
  try {
    t.transform(xmlSource, outputTarget);
  } finally {
    t.reset();
  }
}
origin: org.apache.karaf.instance/org.apache.karaf.instance.core

private void copyBinaryResourceToDir(String resource, File target, Map<String, URL> resources, boolean printOutput) throws IOException {
  File outFile = new File(target, resource);
  if( !outFile.exists() ) {
    logDebug("Creating file: %s", printOutput, outFile.getPath());
    try (
      InputStream is = getResourceStream(resource, resources);
      OutputStream os = new FileOutputStream(outFile)
    ) {
      StreamUtils.copy(is, os);
    }
  }
}
origin: org.apache.karaf.deployer/org.apache.karaf.deployer.blueprint

protected Document parse(File artifact) throws Exception {
  return XmlUtils.parse(artifact, new ErrorHandler() {
    public void warning(SAXParseException exception) throws SAXException {
    }
    public void error(SAXParseException exception) throws SAXException {
    }
    public void fatalError(SAXParseException exception) throws SAXException {
      throw exception;
    }
  });
}
origin: org.apache.karaf.deployer/org.apache.karaf.deployer.wrap

public URL transform(URL artifact) throws Exception {
  try
  {
    String path = artifact.getPath();
    String name = path.substring( path.lastIndexOf('/') + 1);
    String[] nv = DeployerUtils.extractNameVersionType( name );
    return new URL("wrap", null, artifact.toExternalForm() + "$Bundle-SymbolicName=" + nv[0] + "&Bundle-Version=" + nv[1]);
  } catch (Exception e) {
    return new URL("wrap", null, artifact.toExternalForm());
  }
}
origin: org.apache.karaf.jaas/org.apache.karaf.jaas.modules

public AutoEncryptionSupport(Map<String, Object> properties) {
  running = true;
  encryptionSupport = new EncryptionSupport(properties);
  executor = Executors.newSingleThreadExecutor(ThreadUtils.namedThreadFactory("encryption"));
  executor.execute(this);
}
origin: org.apache.karaf.profile/org.apache.karaf.profile.core

/**
 * Short-hand builder configuration to use standard Karaf static KAR at current Karaf version
 * @return
 */
public Builder staticFramework() {
  return staticFramework(Version.karafVersion());
}
origin: apache/karaf

public static Document parse(InputStream stream) throws TransformerException, IOException, SAXException, ParserConfigurationException {
  DocumentBuilder db = documentBuilder();
  try {
    return db.parse(stream);
  } finally {
    db.reset();
  }
}
origin: apache/karaf

public static void transform(Source xsltSource, Source xmlSource, Result outputTarget) throws TransformerException {
  Transformer t = transformer(xsltSource);
  try {
    t.transform(xmlSource, outputTarget);
  } finally {
    t.reset();
  }
}
origin: apache/karaf

protected static Document parse(URL url) throws Exception {
  try (InputStream is = url.openStream()) {
    return XmlUtils.parse(is);
  }
}
origin: apache/karaf

public static Document parse(File f) throws TransformerException, IOException, SAXException, ParserConfigurationException {
  DocumentBuilder db = documentBuilder();
  try {
    return db.parse(f);
  } finally {
    db.reset();
  }
}
origin: apache/karaf

protected static Document parse(URL url) throws Exception {
  try (InputStream is = url.openStream()) {
    return XmlUtils.parse(is);
  }
}
origin: apache/karaf

public static Document parse(String uri) throws TransformerException, IOException, SAXException, ParserConfigurationException {
  DocumentBuilder db = documentBuilder();
  try {
    return db.parse(uri);
  } finally {
    db.reset();
  }
}
origin: org.apache.karaf.deployer/org.apache.karaf.deployer.blueprint

protected static Document parse(URL url) throws Exception {
  try (InputStream is = url.openStream()) {
    return XmlUtils.parse(is);
  }
}
org.apache.karaf.util

Most used classes

  • Services
  • ProvideService
  • RequireService
  • BaseActivator
  • Managed
  • JaasHelper,
  • Parser,
  • PropertiesLoader,
  • DeployerUtils,
  • XmlUtils,
  • BundleUtils,
  • StringEscapeUtils,
  • ThreadUtils,
  • FilesStream,
  • JsonReader,
  • FileLockUtils,
  • SingleServiceTracker,
  • Version,
  • JsonWriter
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