Package uk.gov.nationalarchives.droid.profile

Examples of uk.gov.nationalarchives.droid.profile.FileProfileResource


    private List<AbstractProfileResource> buildFileResources(String[] locations) {
        List<AbstractProfileResource> resources = new ArrayList<AbstractProfileResource>();

        for (String location : locations) {
            FileProfileResource resource = new FileProfileResource(new File(
                    location));
            resources.add(resource);
        }

        return resources;
View Full Code Here


            // VERY basic shortcut detection:
            boolean isShortcut = !selectedFile.toURI().getPath().endsWith("/");
            if (selectedFile.isDirectory() && !isShortcut) {
                newResource = new DirectoryProfileResource(selectedFile, recursive);
            } else {
                newResource = new FileProfileResource(selectedFile);
            }

            if (profile.addResource(newResource)) {
                ProfileResourceNode primordialNode = new ProfileResourceNode(newResource.getUri());
                final NodeMetaData metaData = primordialNode.getMetaData();
View Full Code Here

        when(profileManager.createProfile(sigs)).thenReturn(profileInstance);
       
        Future future = mock(Future.class);
        when(profileManager.start("abcde")).thenReturn(future);
       
        FileProfileResource resource1 = new FileProfileResource(new File("test1.txt"));
        FileProfileResource resource2 = new FileProfileResource(new File("test2.txt"));
       
        when(locationResolver.getResource("test1.txt", false)).thenReturn(resource1);
        when(locationResolver.getResource("test2.txt", false)).thenReturn(resource2);
       
        command.execute();
View Full Code Here

     */
    public AbstractProfileResource getResource(String location, boolean recursive) {
       
        File f = new File(location);
        if (f.isFile()) {
            return new FileProfileResource(f);
        } else if (f.isDirectory()) {
            return new DirectoryProfileResource(f, recursive);
        } else {
            throw new IllegalArgumentException(
                    String.format("Unknown location [%s]", location));
View Full Code Here

TOP

Related Classes of uk.gov.nationalarchives.droid.profile.FileProfileResource

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.