@@ -0,0 +1,2693 @@
+/**%0A * $RCSfile: ,v $%0A * $Revision: $%0A * $Date: $%0A * %0A * Copyright (C) 2004-2010 Jive Software. All rights reserved.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.jivesoftware.sparkimpl.settings.local;%0A%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.io.StringWriter;%0A%0A/**%0A * Class that helps getting the My Documents Folder on Windows via the registry%0A * %0A * @author wolf.posdorfer%0A * %0A */%0Apublic class WinRegistryReader %7B%0A%0A    private static final String REGQUERY_UTIL = %22reg query %22;%0A    private static final String REGSTR_TOKEN = %22REG_SZ%22;%0A    private static final String REGDWORD_TOKEN = %22REG_DWORD%22;%0A%0A    private static final String PERSONAL_FOLDER_CMD = REGQUERY_UTIL%0A            + %22%5C%22HKCU%5C%5CSoftware%5C%5CMicrosoft%5C%5CWindows%5C%5CCurrentVersion%5C%5C%22%0A            + %22Explorer%5C%5CShell Folders%5C%22 /v Personal%22;%0A%0A    /**%0A     * returns the Path to the %22My Documents%22 folder or %3Ccode%3Enull%3C/code%3E%0A     * %0A     * @return %7B@link String%7D%0A     */%0A    public static String getMyDocumentsFromWinRegistry() %7B%0A        try %7B%0A            Process process = Runtime.getRuntime().exec(PERSONAL_FOLDER_CMD);%0A            StreamReader streamreader = new StreamReader(process.getInputStream());%0A%0A            streamreader.start();%0A            process.waitFor();%0A            streamreader.join();%0A%0A            String result = streamreader.getResult();%0A            int p = result.indexOf(REGSTR_TOKEN);%0A%0A            if (p == -1)%0A                return null;%0A%0A            return result.substring(p + REGSTR_TOKEN.length()).trim();%0A        %7D catch (Exception e) %7B%0A            return null;%0A        %7D%0A    %7D%0A%0A    static class StreamReader extends Thread %7B%0A        private InputStream is;%0A        private StringWriter sw;%0A%0A        StreamReader(InputStream is) %7B%0A            this.is = is;%0A            sw = new StringWriter();%0A        %7D%0A%0A        @Override%0A        public void run() %7B%0A            try %7B%0A                int c;%0A                while ((c = is.read()) != -1)%0A                    sw.write(c);%0A            %7D catch (IOException e) %7B%0A                System.err.println(e);%0A            %7D%0A        %7D%0A%0A        String getResult() %7B%0A            return sw.toString();%0A        %7D%0A    %7D%0A%7D%0A

Change the default file transfer save path