したらばTOP ■掲示板に戻る■ 全部 1-100 最新50 | |
レス数が1スレッドの最大レス数(1000件)を超えています。残念ながら投稿することができません。

ヒッキープログラミングスレ

143わたあ ◆dRaGonNY3U:2013/04/05(金) 13:54:32 ID:???
removeとremoveAllの修正忘れてた


public boolean remove(URI uri, HttpCookie cookie) {
System.out.println("MyCookieStore.remove("+uri+", "+cookie+")");
this.cookies.remove(cookie);
File dir = new File(this.cookiedir, cookie.getDomain().replace(".", "_"));
if (dir.exists() == false) return true;
File file = new File(dir, cookie.getName());
if (file.exists()) file.delete();
if (dir.listFiles().length == 0) dir.delete();
return true;
}

public boolean removeAll() {
System.out.println("MyCookieStore.removeAll()");
this.cookies.clear();
File[] dirs = this.cookiedir.listFiles(new FileFilter(){
public boolean accept(File pathname) {
return pathname.isDirectory();
}
});
for (int i = 0; i < dirs.length; i++) {
File[] files = dirs[i].listFiles(new FileFilter(){
public boolean accept(File pathname) {
return pathname.isFile();
}
});
for (int j = 0; j < files.length; j++) {
files[j].delete();
}
if (dirs[i].listFiles().length == 0) dirs[i].delete();
}
return true;
}




掲示板管理者へ連絡 無料レンタル掲示板