OSDN Git Service

コンパイルエラー対応
authoryukihane <yukihane.feather@gmail.com>
Sat, 17 Sep 2011 06:13:30 +0000 (15:13 +0900)
committeryukihane <yukihane.feather@gmail.com>
Sat, 17 Sep 2011 06:13:30 +0000 (15:13 +0900)
frontend/src/saccubus/net/CookieWinFirefox4.java

index ee55714..211e9a9 100644 (file)
@@ -1,6 +1,9 @@
 package saccubus.net;
 
 package saccubus.net;
 
+import java.io.File;
 import java.io.IOException;
 import java.io.IOException;
+import java.nio.file.Path;
+import org.apache.commons.io.FileUtils;
 
 /**
  *
 
 /**
  *
@@ -20,12 +23,13 @@ public class CookieWinFirefox4 extends Cookie {
             if (app_dir == null || app_dir.isEmpty()) {
                 return "";
             }
             if (app_dir == null || app_dir.isEmpty()) {
                 return "";
             }
-            String[] userLists = Path.GetFiles(app_dir + "\\Mozilla\\Firefox\\Profiles\\");
-            for (String user_dir : userLists) {
-                String sqlist_filename = user_dir + "\\cookies.sqlite";
-                if (Path.isFile(sqlist_filename)) {
-                    String dataStr = Path.ReadAllText(sqlist_filename, "US-ASCII");
-                    user_session = CutUserSession(dataStr, sqlist_filename);
+            File dir = new File(app_dir + "\\Mozilla\\Firefox\\Profiles\\");
+            File[] userLists = dir.listFiles();
+            for (File user_dir : userLists) {
+                File sqlist_filename = new File(user_dir, "cookies.sqlite");
+                if (sqlist_filename.isFile()) {
+                    String dataStr = FileUtils.readFileToString(sqlist_filename, "US-ASCII");
+                    user_session = cutUserSession(dataStr);
                     if (!user_session.isEmpty()) {
                         return user_session;
                     }
                     if (!user_session.isEmpty()) {
                         return user_session;
                     }