mirror of https://github.com/kurisufriend/Clover
Avoids a crash with StorageHelper.canNavigate because we indeed can't navigate to a nonexistant folder. Move the FileItem and FileItems classes to FileWatcher as inner classes, they're not general models. Closes #239multisite^2
parent
8e11f039a9
commit
0ee851f30e
@ -1,46 +0,0 @@ |
||||
/* |
||||
* Clover - 4chan browser https://github.com/Floens/Clover/
|
||||
* Copyright (C) 2014 Floens |
||||
* |
||||
* This program is free software: you can redistribute it and/or modify |
||||
* it under the terms of the GNU General Public License as published by |
||||
* the Free Software Foundation, either version 3 of the License, or |
||||
* (at your option) any later version. |
||||
* |
||||
* This program is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Public License |
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/ |
||||
package org.floens.chan.core.model; |
||||
|
||||
import org.floens.chan.core.saver.StorageHelper; |
||||
|
||||
import java.io.File; |
||||
|
||||
public class FileItem { |
||||
public File file; |
||||
|
||||
public FileItem(File file) { |
||||
this.file = file; |
||||
} |
||||
|
||||
public boolean isFile() { |
||||
return file.isFile(); |
||||
} |
||||
|
||||
public boolean isFolder() { |
||||
return file.isDirectory(); |
||||
} |
||||
|
||||
public boolean canNavigate() { |
||||
return StorageHelper.canNavigate(file); |
||||
} |
||||
|
||||
public boolean canOpen() { |
||||
return StorageHelper.canOpen(file); |
||||
} |
||||
} |
@ -1,34 +0,0 @@ |
||||
/* |
||||
* Clover - 4chan browser https://github.com/Floens/Clover/
|
||||
* Copyright (C) 2014 Floens |
||||
* |
||||
* This program is free software: you can redistribute it and/or modify |
||||
* it under the terms of the GNU General Public License as published by |
||||
* the Free Software Foundation, either version 3 of the License, or |
||||
* (at your option) any later version. |
||||
* |
||||
* This program is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Public License |
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/ |
||||
package org.floens.chan.core.model; |
||||
|
||||
import java.io.File; |
||||
import java.util.List; |
||||
|
||||
public class FileItems { |
||||
public final File path; |
||||
public final List<FileItem> fileItems; |
||||
|
||||
public final boolean canNavigateUp; |
||||
|
||||
public FileItems(File path, List<FileItem> fileItems, boolean canNavigateUp) { |
||||
this.path = path; |
||||
this.fileItems = fileItems; |
||||
this.canNavigateUp = canNavigateUp; |
||||
} |
||||
} |
Loading…
Reference in new issue