Examples of FileDocumentSource


Examples of org.apache.any23.source.FileDocumentSource

    public static final class MimeDetectorDocumentSourceConverter implements IStringConverter<DocumentSource> {

        @Override
        public DocumentSource convert( String document ) {
            if (document.startsWith(FILE_DOCUMENT_PREFIX)) {
                return new FileDocumentSource( new File( document.substring(FILE_DOCUMENT_PREFIX.length()) ) );
            }
            if (document.startsWith(INLINE_DOCUMENT_PREFIX)) {
                return new StringDocumentSource( document.substring(INLINE_DOCUMENT_PREFIX.length()), "" );
            }
            if (document.matches(URL_DOCUMENT_RE)) {
View Full Code Here

Examples of org.apache.jackrabbit.vault.util.diff.FileDocumentSource

            // we currently do not use document sources, since we don't really have
            // a label to provide (like rev. num, etc).
            Reader r0 = baseFile.getReader();
            Reader r1 = tmpFile.getReader();
            Document baseDoc = new Document(null, LineElementsFactory.create(new MetaFileDocSource(baseFile), r0, false));
            Document leftDoc = new Document(null, LineElementsFactory.create(new FileDocumentSource(file), false, Constants.ENCODING));
            Document rightDoc = new Document(null, LineElementsFactory.create(new MetaFileDocSource(tmpFile), r1, false));

            DocumentDiff3 diff;
            try {
                diff = baseDoc.diff3(leftDoc, rightDoc);
View Full Code Here

Examples of org.apache.jackrabbit.vault.util.diff.FileDocumentSource

            MetaFile baseFile = getBaseFile(false);
            Reader r0 = baseFile.getReader();
            Reader r1 = tmpFile.getReader();
            Document baseDoc = new Document(null, LineElementsFactory.create(new MetaFileDocSource(baseFile), r0, false));
            Document leftDoc = new Document(null, LineElementsFactory.create(new FileDocumentSource(file), false, Constants.ENCODING));
            Document rightDoc = new Document(null, LineElementsFactory.create(new MetaFileDocSource(tmpFile), r1, false));

            DocumentDiff3 diff;
            try {
                diff = baseDoc.diff3(leftDoc, rightDoc);
View Full Code Here

Examples of org.semanticweb.owlapi.io.FileDocumentSource

    }

    @Override
    public OWLOntology loadOntologyFromOntologyDocument(File file)
            throws OWLOntologyCreationException {
        return loadOntologyFromOntologyDocument(new FileDocumentSource(file));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.io.FileDocumentSource

                    oConfSrc = new IRIDocumentSource(iri);
                } catch (Exception e) {
                    try {
                        log.debug("Cannot load from the web", e1);
                        log.debug("Try to load the configuration ontology as full local file path");
                        oConfSrc = new FileDocumentSource(new File(configPath));
                    } catch (Exception e2) {
                        log.error("Cannot load the configuration ontology from parameter value: "
                                  + configPath, e2);
                    }
                }
View Full Code Here

Examples of org.semanticweb.owlapi.io.FileDocumentSource

    public static synchronized OWLOntologyDocumentSource getOntologyInputSource(URI uri) throws ODPRegistryCacheException,
                                                                                        URIUnresolvableException {
        if (getUnresolvedURIs().contains(uri)) throw new URIUnresolvableException();
        if (uris.containsKey(uri)) {
            File f = uris.get(uri);
            FileDocumentSource fds = new FileDocumentSource(f);
            return fds;
        } else {
            try {
                retrieveRemoteResource(uri);
                return getOntologyInputSource(uri);
View Full Code Here

Examples of org.semanticweb.owlapi.io.FileDocumentSource


            try {
                OWLOntologyLoaderConfiguration config = new OWLOntologyLoaderConfiguration();
                config = config.setMissingImportHandlingStrategy(MissingImportHandlingStrategy.SILENT);
                FileDocumentSource documentSource = new FileDocumentSource(rootOntologyDocument);
                logger.info(projectId, "Loading root ontology imports closure.");
                OWLOntology rootOntology = manager.loadOntologyFromOntologyDocument(documentSource, config);
                importsCacheManager.cacheImports(rootOntology);
                return rootOntology;
View Full Code Here

Examples of org.semanticweb.owlapi.io.FileDocumentSource

            this.baseDirectory = baseDirectory;
        }

        @Override
        public Collection<OWLOntologyDocumentSource> getDocumentSources() {
            return Lists.<OWLOntologyDocumentSource>newArrayList(new FileDocumentSource(rootOntologyDocument));
        }
View Full Code Here

Examples of org.semanticweb.owlapi.io.FileDocumentSource

            this.ontologyDocument = ontologyDocument;
        }

        @Override
        public Collection<OWLOntologyDocumentSource> getDocumentSources() {
            return Lists.<OWLOntologyDocumentSource>newArrayList(new FileDocumentSource(ontologyDocument));
        }
View Full Code Here

Examples of org.semanticweb.owlapi.io.FileDocumentSource

    public OWLOntology loadOntologyFromOntologyDocument(OWLOntologyDocumentSource documentSource, OWLOntologyLoaderConfiguration config) throws OWLOntologyCreationException {
        return loadOntology(null, documentSource, config);
    }

    public OWLOntology loadOntologyFromOntologyDocument(File file) throws OWLOntologyCreationException {
        return loadOntologyFromOntologyDocument(new FileDocumentSource(file));
    }
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.