Search in sources :

Example 1 with SecurePathValidator

use of org.craftercms.commons.validation.validators.impl.SecurePathValidator in project core by craftercms.

the class FileSystemContentStoreAdapterTest method setUpTestStoreAdapter.

private void setUpTestStoreAdapter() throws IOException {
    ResourceLoader resourceLoader = mock(ResourceLoader.class);
    when(resourceLoader.getResource(CLASSPATH_STORE_ROOT_FOLDER_PATH)).thenReturn(new ClassPathResource(CLASSPATH_STORE_ROOT_FOLDER_PATH));
    storeAdapter = new FileSystemContentStoreAdapter();
    storeAdapter.setCacheTemplate(cacheTemplate);
    storeAdapter.setResourceLoader(resourceLoader);
    storeAdapter.setDescriptorFileExtension(DESCRIPTOR_FILE_EXTENSION);
    storeAdapter.setMetadataFileExtension(METADATA_FILE_EXTENSION);
    storeAdapter.setPathValidator(new SecurePathValidator("path"));
}
Also used : ResourceLoader(org.springframework.core.io.ResourceLoader) SecurePathValidator(org.craftercms.commons.validation.validators.impl.SecurePathValidator) ClassPathResource(org.springframework.core.io.ClassPathResource)

Aggregations

SecurePathValidator (org.craftercms.commons.validation.validators.impl.SecurePathValidator)1 ClassPathResource (org.springframework.core.io.ClassPathResource)1 ResourceLoader (org.springframework.core.io.ResourceLoader)1