本文整理匯總了Java中com.webcodepro.applecommander.storage.Disk.isSDK方法的典型用法代碼示例。如果您正苦於以下問題:Java Disk.isSDK方法的具體用法?Java Disk.isSDK怎麽用?Java Disk.isSDK使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.webcodepro.applecommander.storage.Disk
的用法示例。
在下文中一共展示了Disk.isSDK方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: deleteFile
import com.webcodepro.applecommander.storage.Disk; //導入方法依賴的package包/類
/**
* Delete the file named fileName from the disk named imageName.
*/
static void deleteFile(String imageName, String fileName)
throws IOException {
Disk disk = new Disk(imageName);
Name name = new Name(fileName);
if (!disk.isSDK() && !disk.isDC42()) {
FormattedDisk[] formattedDisks = disk.getFormattedDisks();
for (int i = 0; i < formattedDisks.length; i++) {
FormattedDisk formattedDisk = formattedDisks[i];
FileEntry entry = name.getEntry(formattedDisk);
if (entry != null) {
entry.delete();
disk.save();
} else {
System.err.println(textBundle.format(
"CommandLineNoMatchMessage", name.fullName)); //$NON-NLS-1$
}
}
}
else
throw new IOException(textBundle.get("CommandLineSDKReadOnly"));
}
示例2: setFileLocked
import com.webcodepro.applecommander.storage.Disk; //導入方法依賴的package包/類
/**
* Set the lockState of the file named fileName on the disk named imageName.
* Proposed by David Schmidt.
*/
static void setFileLocked(String imageName, Name name,
boolean lockState) throws IOException {
Disk disk = new Disk(imageName);
if (!disk.isSDK() && !disk.isDC42()) {
FormattedDisk[] formattedDisks = disk.getFormattedDisks();
for (int i = 0; i < formattedDisks.length; i++) {
FormattedDisk formattedDisk = formattedDisks[i];
FileEntry entry = name.getEntry(formattedDisk);
if (entry != null) {
entry.setLocked(lockState);
disk.save();
} else {
System.err.println(textBundle.format(
"CommandLineNoMatchMessage", name.fullName)); //$NON-NLS-1$
}
}
}
else
throw new IOException(textBundle.get("CommandLineSDKReadOnly"));
}
示例3: putFile
import com.webcodepro.applecommander.storage.Disk; //導入方法依賴的package包/類
/**
* Put <stdin>. into the file named fileName on the disk named imageName;
* Note: only volume level supported; input size unlimited.
*/
static void putFile(String imageName, Name name, String fileType,
String address) throws IOException, DiskFullException {
ByteArrayOutputStream buf = new ByteArrayOutputStream();
byte[] inb = new byte[1024];
int byteCount = 0;
while ((byteCount = System.in.read(inb)) > 0) {
buf.write(inb, 0, byteCount);
}
Disk disk = new Disk(imageName);
FormattedDisk[] formattedDisks = disk.getFormattedDisks();
if (formattedDisks == null)
System.out.println("Dude, formattedDisks is null!");
FormattedDisk formattedDisk = formattedDisks[0];
if (!disk.isSDK() && !disk.isDC42()) {
FileEntry entry = name.createEntry(formattedDisk);
if (entry != null) {
entry.setFiletype(fileType);
entry.setFilename(name.name);
entry.setFileData(buf.toByteArray());
if (entry.needsAddress()) {
entry.setAddress(stringToInt(address));
}
formattedDisk.save();
} else {
throw new IOException("Unable to create entry...");
}
}
else
throw new IOException(textBundle.get("CommandLineSDKReadOnly")); //$NON-NLS-1$
}
示例4: setDiskName
import com.webcodepro.applecommander.storage.Disk; //導入方法依賴的package包/類
/**
* Set the volume name for a given disk image. Only effective for ProDOS or
* Pascal disks; others ignored. Proposed by David Schmidt.
*/
public static void setDiskName(String imageName, String volName)
throws IOException {
Disk disk = new Disk(imageName);
if (!disk.isSDK() && !disk.isDC42()) {
FormattedDisk[] formattedDisks = disk.getFormattedDisks();
FormattedDisk formattedDisk = formattedDisks[0];
formattedDisk.setDiskName(volName);
formattedDisks[0].save();
}
else
throw new IOException(textBundle.get("CommandLineSDKReadOnly"));
}
示例5: putFile
import com.webcodepro.applecommander.storage.Disk; //導入方法依賴的package包/類
/**
* Put <stdin>. into the file named fileName on the disk named imageName;
* Note: only volume level supported; input size unlimited.
*/
static void putFile(String imageName, Name name, String fileType,
String address) throws IOException, DiskFullException {
ByteArrayOutputStream buf = new ByteArrayOutputStream();
byte[] inb = new byte[1024];
int byteCount = 0;
while ((byteCount = System.in.read(inb)) > 0) {
buf.write(inb, 0, byteCount);
}
Disk disk = new Disk(imageName);
FormattedDisk[] formattedDisks = disk.getFormattedDisks();
if (formattedDisks == null)
System.out.println("Dude, formattedDisks is null!");
FormattedDisk formattedDisk = formattedDisks[0];
if (!disk.isSDK() && !disk.isDC42()) {
FileEntry entry = name.createEntry(formattedDisk);
if (entry != null) {
entry.setFiletype(fileType);
entry.setFilename(name.name);
entry.setFileData(buf.toByteArray());
if (entry.needsAddress()) {
entry.setAddress(stringToInt(address));
}
formattedDisk.save();
}
}
else
throw new IOException(textBundle.get("CommandLineSDKReadOnly")); //$NON-NLS-1$
}