package fs.command;

/**
 *
 * @author José Andrés García Sáenz <jags9415@gmail.com>
 */
public class MakeDirectoryCommand extends Command {

    public static final String COMMAND = "mkdir";
    
    @Override
    public void execute(String[] args) {
        if (args.length < 2) {
            reportSyntaxError();
            return;
        }
    }

    @Override
    protected String getSyntax() {
        return getName() + " DIRECTORY...";
    }

    @Override
    protected String getDescription() {
        return "Create the DIRECTORY(ies), if they do not already exist.";
    }

    @Override
    protected String getName() {
        return COMMAND;
    }
    
}

@@ -14,16 +14,113 @@
 mmand;%0A%0A
+import fs.App;%0Aimport fs.Disk;%0Aimport java.io.BufferedReader;%0Aimport java.io.InputStreamReader;%0A%0A
 /**%0A *%0A 
@@ -432,24 +432,923 @@
 ;%0A        %7D%0A
+        %0A        String path = args%5B1%5D;%0A        App app = App.getInstance();%0A        Disk disk = app.getDisk();%0A        %0A        try%0A        %7B%0A            if(disk.exists(path))%0A            %7B%0A                System.out.print(%22There is already a directory with the same name. Do you want to override it? %5By/n%5D %22);%0A                    BufferedReader input = new BufferedReader(new InputStreamReader(System.in));%0A                    String line = input.readLine();%0A                    if (!line.equalsIgnoreCase(%22y%22)) %0A                    %7B%0A                        return;%0A                    %7D%0A                    disk.deleteDirectory(path);%0A                    disk.createDirectory(path);%0A                    %0A                    System.out.println(%22Directory created successfully.%22);%0A            %7D%0A        %7D%0A        catch (Exception ex) %0A        %7B%0A            reportError(ex.getMessage());%0A        %7D%0A
     %7D%0A%0A    @

Make directory command implemented.