Commit 2147e5fe authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Other fixes for special characters

parent 50052eeb
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ public class FileServiceClient {

    public String startArchiveJob(Transfer transfer, String jobId) {

        String target = transfer.getTarget().substring("vos://".length() + authority.length());
        String target = NodeUtils.getVosPath(transfer.getTarget());

        String viewUri = transfer.getView().getUri();

+1 −3
Original line number Diff line number Diff line
@@ -181,8 +181,7 @@ public class UriService {

    private String getEndpoint(JobSummary job, Transfer transfer) {

        String relativePath = StringUtils.uriDecode(URIUtils
                .returnVosPathFromNodeURI(transfer.getTarget(), authority), StandardCharsets.UTF_8);
        String relativePath = NodeUtils.getVosPath(transfer.getTarget());

        User user = (User) servletRequest.getUserPrincipal();
        String creator = user.getName();
@@ -204,7 +203,6 @@ public class UriService {
            case pullFromVoSpace:
                // Refresh relative path: it can differ in case of links followed 
                relativePath = NodeUtils.getVosPath(node);
                relativePath = StringUtils.uriDecode(relativePath, StandardCharsets.UTF_8);
                if (!NodeUtils.checkIfReadable(node, creator, groups)) {
                    throw PermissionDeniedException.forPath(relativePath);
                }
+5 −5
Original line number Diff line number Diff line
@@ -101,23 +101,23 @@ public class FileServiceClientTest {

        Transfer transfer = new Transfer();
        transfer.setDirection("pullFromVoSpace");
        transfer.setTarget("vos://example.com!vospace/mydir");
        transfer.setTarget("vos://example.com!vospace/mydir(%20+%20)x");
        View view = new View();
        view.setUri(Views.ZIP_VIEW_URI);
        transfer.setView(view);
        
        ContainerNode node = Mockito.mock(ContainerNode.class);
        when(node.getNodes()).thenReturn(List.of());
        when(node.getUri()).thenReturn("vos://example.com!vospace/mydir");
        when(nodeDAO.listNode(eq("/mydir"))).thenReturn(Optional.of(node));
        when(node.getUri()).thenReturn("vos://example.com!vospace/mydir(%20+%20)x");
        when(nodeDAO.listNode(eq("/mydir( + )x"))).thenReturn(Optional.of(node));
        
        when(linkService.followLinksForArchiveService(any()))
                .thenReturn(List.of(new ArchiveEntryDescriptor("/mydir")));
                .thenReturn(List.of(new ArchiveEntryDescriptor("/mydir( + )x")));

        ArchiveRequest archiveRequest = testStartArchiveJob(transfer);

        assertEquals(1, archiveRequest.getEntryDescriptors().size());
        assertEquals("/mydir", archiveRequest.getEntryDescriptors().get(0).getTargetNodeVosPath());
        assertEquals("/mydir( + )x", archiveRequest.getEntryDescriptors().get(0).getTargetNodeVosPath());
    }

    @Test
+1 −1

File changed.

Contains only whitespace changes.