Package uk.ac.osswatch.simal.rdf

Examples of uk.ac.osswatch.simal.rdf.SimalRepositoryException


          return new JenaPersonService(getInstance());
        case JCR:
          // commented out as this code moved to a branch - do we need to remove it yet?
            // return new JcrPersonService(getInstance());
        default:
          throw new SimalRepositoryException("Attempt to create an unknown repository type");
      }
  }
View Full Code Here


          return new JenaRepositoryService(getInstance());
        case JCR:
          // commented out as this code moved to a branch - do we need to remove it yet?
            // return new JcrRepositoryService(getInstance());
        default:
          throw new SimalRepositoryException("Attempt to create an unknown repository type");
      }
  }
View Full Code Here

        .getResource(resourceFilename);
    if (defaultsLocation != null) {
      try {
        homepageLabels.load(defaultsLocation.openStream());
      } catch (IOException e) {
        throw new SimalRepositoryException(
            "Could not load homepageLabels from resource "
                + defaultsLocation, e);
      }
    }
View Full Code Here

    try {
      person = SimalRepositoryFactory.getPersonService().create(uri);
      person.setSimalID(id);
      populatePerson(person);
    } catch (DuplicateURIException e) {
      throw new SimalRepositoryException("Unable to create a new person", e);
    }
    return person;
  }
View Full Code Here

      defaultProps = new Properties();
      defaultProps.load(defaultsLocation.openStream());
    } catch (Exception e) {
      String msg = "Unable to load default properties file from "
          + defaultsLocation;
      throw new SimalRepositoryException(msg, e);
    }

    File propsFile = getLocalPropertiesFile();
    if (propsFile.exists()) {
      logger.debug("Initializing local properties from " + propsFile.getAbsolutePath());
View Full Code Here

    InputStream in = null;
    try {
      in = new FileInputStream(propsFile);
      props.load(in);
    } catch (IOException e) {
      throw new SimalRepositoryException("Unable to load properties file: "
          + propsFile, e);
    } finally {
      try {
        if (in != null) {
          in.close();
        }
      } catch (IOException e) {
        throw new SimalRepositoryException("Unable to close properties file: "
            + propsFile, e);
      }
    }
    return props;
  }
View Full Code Here

            .append("default.simal.properties files or the SimalProperties class");

        String msg = sb.toString();
        logger.warn(msg);

        throw new SimalRepositoryException(msg);
      }
    }

    return value;
  }
View Full Code Here

    FileOutputStream out = null;
    try {
      if (!propsFile.exists()) {
        boolean created = propsFile.createNewFile();
        if (!created) {
          throw new SimalRepositoryException(
              "Unable to create properties file: " + propsFile.toString());
        }
      }
      out = new FileOutputStream(propsFile);
      localProps.store(out, comments);
    } catch (IOException e) {
      throw new SimalRepositoryException("Failed to save properties file to "
          + propsFile, e);
    } finally {
      try {
        if (out != null) {
          out.close();
        }
      } catch (IOException e) {
        throw new SimalRepositoryException("Unable to close properties file: "
            + propsFile, e);
      }
    }
  }
View Full Code Here

    try {
      review = service.create(uri);
      review.setSimalID(id);
      populateReview(review, IReview.TYPE_OPENNESS);
    } catch (DuplicateURIException e) {
      throw new SimalRepositoryException("Unable to create a new review", e);
    }
    return review;
  }
View Full Code Here

  public void setSimalID(String id) throws SimalRepositoryException {
  if (id.contains(":")
        && !id.startsWith(SimalProperties
            .getProperty((SimalProperties.PROPERTY_SIMAL_INSTANCE_ID)))) {
      throw new SimalRepositoryException("Simal ID cannot contain a ':'");
    }
    logger.info("Setting simalId for " + this + " to " + id);
    getJenaResource().addLiteral(SimalOntology.PERSON_ID, id);
  }
View Full Code Here

TOP

Related Classes of uk.ac.osswatch.simal.rdf.SimalRepositoryException

Copyright © 2018 www.massapicom. 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.