@@ -0,0 +1,1476 @@
+package me.izstas.rfs.server.service;%0A%0Aimport java.io.IOException;%0Aimport java.nio.file.*;%0A%0Aimport me.izstas.rfs.server.RfsException;%0A%0Aclass PathUtils %7B%0A    static RfsException wrapException(IOException e, String message) %7B%0A        if (e instanceof AccessDeniedException) %7B%0A            return new InaccessiblePathException(e);%0A        %7D%0A%0A        if (e instanceof NoSuchFileException) %7B%0A            return new NonexistentPathException(e);%0A        %7D%0A%0A        return new RfsException(message, e);%0A    %7D%0A%0A    static void createDirectories(Path path, boolean parent) %7B%0A        try %7B%0A            Files.createDirectories(parent ? path.getParent() : path);%0A        %7D%0A        catch (FileAlreadyExistsException %7C NoSuchFileException e) %7B // While combination of these two may look weird,%0A                                                                     // on Windows we seem to get the latter one%0A                                                                     // if the problem is caused not by the immediate parent%0A                                                                     // but a further ascendant%0A            throw new NonexistentPathException(%22The path contains a file (not a directory) as one of the ascendants%22, e);%0A        %7D%0A        catch (IOException e) %7B%0A            throw wrapException(e, parent ? %22Can't create ascendant directories%22 : %22Can't create directories%22);%0A        %7D%0A    %7D%0A%0A%0A    private PathUtils() %7B%0A        throw new AssertionError();%0A    %7D%0A%7D%0A

Add a class with some utility methods