mirror of
https://github.com/AppleCommander/AppleCommander.git
synced 2024-12-21 17:29:55 +00:00
Fixing a wrongly placed DiskException handler on the command line tool.
This commit is contained in:
parent
ae66b88e0a
commit
f3316262c8
@ -26,6 +26,7 @@ import java.io.PrintStream;
|
||||
import org.apache.tools.ant.BuildException;
|
||||
import org.apache.tools.ant.Task;
|
||||
import com.webcodepro.applecommander.storage.Disk;
|
||||
import com.webcodepro.applecommander.storage.DiskException;
|
||||
import com.webcodepro.applecommander.storage.FormattedDisk;
|
||||
|
||||
public class AntTask extends Task
|
||||
@ -107,7 +108,7 @@ public class AntTask extends Task
|
||||
{
|
||||
com.webcodepro.applecommander.ui.ac.deleteFile(_imageName, _fileName);
|
||||
}
|
||||
catch (IOException io)
|
||||
catch (IOException|DiskException io)
|
||||
{
|
||||
if (_failonerror)
|
||||
throw new BuildException(io);
|
||||
@ -138,7 +139,7 @@ public class AntTask extends Task
|
||||
else // Assume unlock
|
||||
com.webcodepro.applecommander.ui.ac.setFileLocked(_imageName, _fileName, false);
|
||||
}
|
||||
catch (IOException io)
|
||||
catch (IOException|DiskException io)
|
||||
{
|
||||
if (_failonerror)
|
||||
throw new BuildException(io);
|
||||
|
@ -264,7 +264,7 @@ public class ac {
|
||||
* Delete the file named fileName from the disk named imageName.
|
||||
*/
|
||||
static void deleteFile(String imageName, String fileName)
|
||||
throws IOException {
|
||||
throws IOException, DiskException {
|
||||
Disk disk = new Disk(imageName);
|
||||
Name name = new Name(fileName);
|
||||
if (!disk.isSDK() && !disk.isDC42()) {
|
||||
@ -290,7 +290,7 @@ public class ac {
|
||||
* filtered according to its type and sent to <stdout>.
|
||||
*/
|
||||
static void getFile(String imageName, String fileName, boolean filter, PrintStream out)
|
||||
throws IOException {
|
||||
throws IOException, DiskException {
|
||||
Disk disk = new Disk(imageName);
|
||||
Name name = new Name(fileName);
|
||||
FormattedDisk[] formattedDisks = disk.getFormattedDisks();
|
||||
@ -479,7 +479,7 @@ public class ac {
|
||||
* Set the lockState of the file named fileName on the disk named imageName.
|
||||
* Proposed by David Schmidt.
|
||||
*/
|
||||
public static void setFileLocked(String imageName, String name, boolean lockState) throws IOException {
|
||||
public static void setFileLocked(String imageName, String name, boolean lockState) throws IOException, DiskException {
|
||||
setFileLocked(imageName, new Name(name), lockState);
|
||||
}
|
||||
|
||||
@ -488,7 +488,7 @@ public class ac {
|
||||
* Proposed by David Schmidt.
|
||||
*/
|
||||
static void setFileLocked(String imageName, Name name,
|
||||
boolean lockState) throws IOException {
|
||||
boolean lockState) throws IOException, DiskException {
|
||||
Disk disk = new Disk(imageName);
|
||||
if (!disk.isSDK() && !disk.isDC42()) {
|
||||
FormattedDisk[] formattedDisks = disk.getFormattedDisks();
|
||||
@ -620,8 +620,7 @@ public class ac {
|
||||
this.name = path[path.length - 1];
|
||||
}
|
||||
|
||||
public FileEntry getEntry(FormattedDisk formattedDisk) {
|
||||
try {
|
||||
public FileEntry getEntry(FormattedDisk formattedDisk) throws DiskException {
|
||||
List files = formattedDisk.getFiles();
|
||||
FileEntry entry = null;
|
||||
for (int i = 0; i < path.length - 1; i++) {
|
||||
@ -641,9 +640,6 @@ public class ac {
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
} catch (DiskException e) {
|
||||
// FIXME How to warn user about the problem?
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user