package com.llnw.storage.client;

import com.google.common.collect.Lists;
import com.llnw.storage.client.io.ActivityCallback;

import javax.annotation.Nullable;

import java.io.File;
import java.io.IOException;
import java.util.List;

public class MockEndpointFactory extends EndpointFactory {
    public MockEndpointFactory() {
        super(null, null, null);
    }

    @Override
    public Endpoint create(boolean useFTP) {
        return new Endpoint() {
            @Override
            public void deleteDirectory(String path) throws IOException {
            }

            @Override
            public void deleteFile(String path) throws IOException {
            }

            @Override
            public void close() {
            }

            @Override
            public void makeDirectory(String path) throws IOException {
            }

            @Override
            public List<String> listFiles(String path) throws IOException {
                return Lists.newArrayList();
            }

            @Override
            public void upload(File file, String path, String name, @Nullable ActivityCallback callback)
                    throws IOException {
            }

            @Override
            public void noop() throws IOException {
            }

            @Override
            public boolean exists(String path) throws IOException {
                return false;
            }
        };
    }
}

@@ -67,16 +67,51 @@
 .Lists;%0A
+import com.google.common.io.Files;%0A
 import c
@@ -322,16 +322,54 @@
 ctory %7B%0A
+%0A    private final File destination;%0A%0A
     publ
@@ -407,31 +407,149 @@
     
-super(null, null, null)
+this(null);%0A    %7D%0A%0A    public MockEndpointFactory(File destination) %7B%0A        super(null, null, null);%0A        this.destination = destination
 ;%0A  
@@ -549,24 +549,25 @@
 ion;%0A    %7D%0A%0A
+%0A
     @Overrid
@@ -1360,32 +1360,144 @@
 s IOException %7B%0A
+                if (destination != null) %7B%0A                    Files.copy(file, destination);%0A                %7D%0A
             %7D%0A%0A 

Allow for destination file in mock endpoint