Examples of findAbsoluteUrl()


Examples of org.apache.uima.resource.metadata.Import.findAbsoluteUrl()

    Import imp = UIMAFramework.getResourceSpecifierFactory().createImport();

    for (;;) {
      imp.setName(fileName.substring(partStart));
      try {
        imp.findAbsoluteUrl(rm);
      } catch (InvalidXMLException e) {
        partStart = fileName.indexOf('.', partStart) + 1;
        if (0 == partStart)
          return imp; // not found -outer code will catch error later
        continue;
View Full Code Here

Examples of org.apache.uima.resource.metadata.Import.findAbsoluteUrl()

  public static String resolveByName(String input) {
    ResourceManager resourceManager = UIMAFramework.newDefaultResourceManager();
    Import theImport = new Import_impl();
    theImport.setName(input);
    try {
      return theImport.findAbsoluteUrl(resourceManager).toExternalForm();
    } catch (InvalidXMLException e) {
      if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
        UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, XsltImportByName.class.getName(),
                "resolveByName", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
                "UIMAEE_exception__WARNING", new Object[] { e });
View Full Code Here

Examples of org.apache.uima.resource.metadata.Import.findAbsoluteUrl()

  public static String resolveByName(String input) {
    ResourceManager resourceManager = UIMAFramework.newDefaultResourceManager();
    Import theImport = new Import_impl();
    theImport.setName(input);
    try {
      return theImport.findAbsoluteUrl(resourceManager).toExternalForm();
    } catch (InvalidXMLException e) {
      e.printStackTrace();
      return "ERROR converting import by name to absolute path";
    }
  }
View Full Code Here

Examples of org.apache.uima.resource.metadata.Import.findAbsoluteUrl()

     
      if (aFileResource.startsWith(IMPORT_BY_NAME_PREFIX))
      {
        Import theImport = new Import_impl();
        theImport.setName(aFileResource.substring(IMPORT_BY_NAME_PREFIX.length()));
        input = new XMLInputSource(theImport.findAbsoluteUrl(aResourceManager));
      }
      else
      {
        input = new XMLInputSource(aFileResource);
      }
View Full Code Here

Examples of org.apache.uima.resource.metadata.Import.findAbsoluteUrl()

        // new import objects
        if (aeImport instanceof Import_impl) {
          ((Import_impl) aeImport).setSourceUrlIfNull(this.getSourceUrl());
        }
        // locate import target
        URL url = aeImport.findAbsoluteUrl(aResourceManager);

        // check for resursive import
        if (aEnclosingAggregateAeUrls.contains(url)) {
          String name = getMetaData() == null ? "<null>" : getMetaData().getName();
          throw new InvalidXMLException(InvalidXMLException.CIRCULAR_AE_IMPORT, new Object[] {
View Full Code Here

Examples of org.apache.uima.resource.metadata.Import.findAbsoluteUrl()

   * @see FlowControllerDeclaration#resolveImports(org.apache.uima.resource.ResourceManager)
   */
  public void resolveImports(ResourceManager aResourceManager) throws InvalidXMLException {
    Import theImport = getImport();
    if (theImport != null) {
      URL url = theImport.findAbsoluteUrl(aResourceManager);
      InputStream stream = null;
      try {
        stream = url.openStream();
        XMLInputSource input = new XMLInputSource(url);
        ResourceSpecifier spec = UIMAFramework.getXMLParser().parseResourceSpecifier(input);
View Full Code Here

Examples of org.apache.uima.resource.metadata.Import.findAbsoluteUrl()

        // new import objects
        if (aeImport instanceof Import_impl) {
          ((Import_impl) aeImport).setSourceUrlIfNull(this.getSourceUrl());
        }
        // locate import target
        URL url = aeImport.findAbsoluteUrl(aResourceManager);

        // check for resursive import
        if (aEnclosingAggregateAeUrls.contains(url.toString())) {
          String name = getMetaData() == null ? "<null>" : getMetaData().getName();
          throw new InvalidXMLException(InvalidXMLException.CIRCULAR_AE_IMPORT, new Object[] {
View Full Code Here

Examples of org.apache.uima.resource.metadata.Import.findAbsoluteUrl()

    ResourceManager rm = editor.createResourceManager();

    for (;;) {
      imp.setName(fileName.substring(partStart));
      try {
        imp.findAbsoluteUrl(rm);
      } catch (InvalidXMLException e) {
        partStart = fileName.indexOf('.', partStart) + 1;
        if (0 == partStart)
          return imp; // not found -outer code will catch error later
        continue;
View Full Code Here

Examples of org.apache.uima.resource.metadata.Import.findAbsoluteUrl()

   */
  public static CollectionReader createReader(String descriptorName,
          Object... configurationData) throws UIMAException, IOException {
    Import imp = UIMAFramework.getResourceSpecifierFactory().createImport();
    imp.setName(descriptorName);
    URL url = imp.findAbsoluteUrl(UIMAFramework.newDefaultResourceManager());
    ResourceSpecifier specifier = createResourceCreationSpecifier(url, configurationData);
    return UIMAFramework.produceCollectionReader(specifier,
            ResourceManagerFactory.newResourceManager(), null);
  }

View Full Code Here

Examples of org.apache.uima.resource.metadata.impl.Import_impl.findAbsoluteUrl()

   */
  public static AnalysisEngineDescription createEngineDescription(String descriptorName,
          Object... configurationData) throws InvalidXMLException, IOException {
    Import_impl imprt = new Import_impl();
    imprt.setName(descriptorName);
    URL url = imprt.findAbsoluteUrl(UIMAFramework.newDefaultResourceManager());
    ResourceSpecifier specifier = ResourceCreationSpecifierFactory.createResourceCreationSpecifier(
            url, configurationData);
    return (AnalysisEngineDescription) specifier;
  }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.