package ninja.eivind.hotsreplayuploader.services;

import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.net.URI;

public class WindowsService implements PlatformService {

    private Desktop desktop;

    public WindowsService() {
        desktop = Desktop.getDesktop();
    }

    @Override
    public File getApplicationHome() {
        return null;
    }

    @Override
    public File getHotSHome() {
        return null;
    }

    @Override
    public void browse(final URI uri) throws IOException {
        desktop.browse(uri);
    }
}

@@ -82,61 +82,94 @@
 .io.
-File;%0Aimport java.io.IOException;%0Aimport java.net.URI
+*;%0Aimport java.net.URI;%0Aimport java.util.regex.Matcher;%0Aimport java.util.regex.Pattern
 ;%0A%0Ap
@@ -255,16 +255,124 @@
 sktop;%0A%0A
+    private Pattern pathPattern = Pattern.compile(%22%5BA-Z%5D:(%5C%5C%5C%5C%7C%5C%5Cw+%7C )+%22);%0A    private File documentsHome;%0A%0A
     publ
@@ -497,35 +497,1664 @@
 ) %7B%0A        
-return null
+if (documentsHome == null) %7B%0A            try %7B%0A                documentsHome = findMyDocuments();%0A            %7D catch (FileNotFoundException e) %7B%0A                throw new RuntimeException(e);%0A            %7D%0A        %7D%0A        return new File(documentsHome + %22%5C%5C%22 + APPLICATION_DIRECTORY_NAME);%0A    %7D%0A%0A    private File findMyDocuments() throws FileNotFoundException %7B%0A        Process p = null;%0A        String myDocuments = null;%0A        try %7B%0A            p = Runtime.getRuntime().exec(%22reg query %5C%22HKCU%5C%5CSoftware%5C%5CMicrosoft%5C%5CWindows%5C%5CCurrentVersion%5C%5CExplorer%5C%5CShell Folders%5C%22 /v personal%22);%0A            p.waitFor();%0A%0A            try (BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()))) %7B%0A                StringBuilder builder = new StringBuilder();%0A                reader.lines().forEach(builder::append);%0A                final String%5B%5D values = builder.toString().trim().split(%22%5C%5Cs%5C%5Cs+%22);%0A                for (final String value : values) %7B%0A                    System.out.println(value);%0A                    Matcher matcher = pathPattern.matcher(value);%0A                    if (matcher.matches()) %7B%0A                        myDocuments = matcher.group();%0A                        break;%0A                    %7D%0A                %7D%0A            %7D%0A%0A        %7D catch (IOException %7C InterruptedException e) %7B%0A            throw new RuntimeException(e);%0A        %7D finally %7B%0A            if (p != null) %7B%0A                p.destroy();%0A            %7D%0A        %7D%0A%0A        if (myDocuments == null) %7B%0A            throw new FileNotFoundException(%22Could not locate Documents folder%22);%0A        %7D%0A        return new File(myDocuments)
 ;%0A    %7D%0A%0A   

implement getApplicationHome for WindowsService