Package org.apache.jackrabbit.vault.fs.api

Examples of org.apache.jackrabbit.vault.fs.api.SerializationType


        // TODO - refrain from doing I/O here
        // TODO - copied from TransactionImpl
        InputStream in = null;
        try {
            in = new BufferedInputStream(new FileInputStream(file));
            SerializationType serType = XmlAnalyzer.analyze(new InputSource(in));
            return serType == SerializationType.XML_DOCVIEW;
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            IOUtils.closeQuietly(in);
View Full Code Here


        // TODO - refrain from doing I/O here
        // TODO - copied from TransactionImpl
        InputStream in = null;
        try {
            in = new BufferedInputStream(new FileInputStream(file));
            SerializationType serType = XmlAnalyzer.analyze(new InputSource(in));
            if (serType == SerializationType.XML_DOCVIEW) {
                return getPathWithoutXmlExtension(file);
            }

            return file.getAbsolutePath();
View Full Code Here

                int idx = repoName.lastIndexOf('.');
                if (idx > 0) {
                    repoBase = repoName.substring(0, idx);
                    ext = repoName.substring(idx);
                }
                SerializationType serType = SerializationType.GENERIC;
                ArtifactType type = ArtifactType.PRIMARY;
                VaultInputSource is = archive.getInputSource(file);
                if (ext.equals(".xml")) {
                    // this can either be an generic exported docview or a 'user-xml' that is imported as file
                    // btw: this only works for input sources that can refetch their input stream
View Full Code Here

     * @return the serialization type
     * @throws IOException if an I/O error occurs
     */
    public static SerializationType analyze(InputSource source) throws IOException {
        Reader r = source.getCharacterStream();
        SerializationType type = SerializationType.UNKOWN;
        if (r == null) {
            if (source.getEncoding() == null) {
                r = new InputStreamReader(source.getByteStream());
            } else {
                r = new InputStreamReader(source.getByteStream(), source.getEncoding());
View Full Code Here

     * @return the serialization type
     * @throws java.io.IOException if an I/O error occurs
     */
    public static SerializationType analyze(InputSource source) throws IOException {
        Reader r = source.getCharacterStream();
        SerializationType type = SerializationType.UNKOWN;
        if (r == null) {
            if (source.getEncoding() == null) {
                r = new InputStreamReader(source.getByteStream());
            } else {
                r = new InputStreamReader(source.getByteStream(), source.getEncoding());
View Full Code Here

                return Type.DIRECTORY;
            }
        } else if (file.isFile()) {
            // check for vlt serialized XMLs and mark them as unsupported
            try {
                SerializationType type = XmlAnalyzer.analyze(new FileInputSource(file));
                if (type == SerializationType.XML_DOCVIEW) {
                    return Type.UNSUPPORTED;
                }
            } catch (IOException e) {
                log.warn("Unable to analyze {}: {}", file.getAbsolutePath(), e.toString());
View Full Code Here

                int idx = repoName.lastIndexOf('.');
                if (idx > 0) {
                    repoBase = repoName.substring(0, idx);
                    ext = repoName.substring(idx);
                }
                SerializationType serType = SerializationType.GENERIC;
                ArtifactType type = ArtifactType.PRIMARY;
                VaultInputSource is = archive.getInputSource(file);
                if (ext.equals(".xml")) {
                    // this can either be an generic exported docview or a 'user-xml' that is imported as file
                    // btw: this only works for input sources that can refetch their input stream
View Full Code Here

            change.isa = isa;
            return new VaultFileOutputImpl(change);

        } else {
            // normal file, detect type
            SerializationType serType = SerializationType.GENERIC;
            ArtifactType aType = ArtifactType.FILE;
            String extension = "";
            int idx = repoName.lastIndexOf('.');
            if (idx > 0) {
                String base = repoName.substring(0, idx);
View Full Code Here

                int idx = repoName.lastIndexOf('.');
                if (idx > 0) {
                    repoBase = repoName.substring(0, idx);
                    ext = repoName.substring(idx);
                }
                SerializationType serType = SerializationType.GENERIC;
                ArtifactType type = ArtifactType.PRIMARY;
                VaultInputSource is = archive.getInputSource(file);
                if (ext.equals(".xml")) {
                    // this can either be an generic exported docview or a 'user-xml' that is imported as file
                    // btw: this only works for input sources that can refetch their input stream
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.vault.fs.api.SerializationType

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.