Package org.jboss.dna.common.text

Examples of org.jboss.dna.common.text.FilenameEncoder.encode()


    public void shouldEncodeDirectoryNames() {
        // Set up an encoder and make sure that the names for the index and workspace can't be used as file system names ...
        FilenameEncoder encoder = new FilenameEncoder();
        index = "some/special::/\nindex(name)";
        workspace = "some/special::/\nworkspace(name)/illegalInWindows:\\/?%*|\"'<>.txt";
        assertThat(index, is(not(encoder.encode(index))));
        assertThat(workspace, is(not(encoder.encode(workspace))));

        config = LuceneConfigurations.using(tempArea, null, encoder, encoder);
        assertThat(config, is(notNullValue()));
        directory = getDirectory(config, workspace, index);
View Full Code Here


        // Set up an encoder and make sure that the names for the index and workspace can't be used as file system names ...
        FilenameEncoder encoder = new FilenameEncoder();
        index = "some/special::/\nindex(name)";
        workspace = "some/special::/\nworkspace(name)/illegalInWindows:\\/?%*|\"'<>.txt";
        assertThat(index, is(not(encoder.encode(index))));
        assertThat(workspace, is(not(encoder.encode(workspace))));

        config = LuceneConfigurations.using(tempArea, null, encoder, encoder);
        assertThat(config, is(notNullValue()));
        directory = getDirectory(config, workspace, index);
        assertThat(directory, is(instanceOf(FSDirectory.class)));
View Full Code Here

        config = LuceneConfigurations.using(tempArea, null, encoder, encoder);
        assertThat(config, is(notNullValue()));
        directory = getDirectory(config, workspace, index);
        assertThat(directory, is(instanceOf(FSDirectory.class)));
        FSDirectory fsDirectory = (FSDirectory)directory;
        assertThat(fsDirectory.getFile().getName(), is(encoder.encode(index)));
        assertThat(fsDirectory.getFile().getParentFile().getName(), is(encoder.encode(workspace)));
    }
}
View Full Code Here

        assertThat(config, is(notNullValue()));
        directory = getDirectory(config, workspace, index);
        assertThat(directory, is(instanceOf(FSDirectory.class)));
        FSDirectory fsDirectory = (FSDirectory)directory;
        assertThat(fsDirectory.getFile().getName(), is(encoder.encode(index)));
        assertThat(fsDirectory.getFile().getParentFile().getName(), is(encoder.encode(workspace)));
    }
}
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.