本文整理汇总了Java中com.webcodepro.applecommander.storage.Disk.isDC42方法的典型用法代码示例。如果您正苦于以下问题:Java Disk.isDC42方法的具体用法?Java Disk.isDC42怎么用?Java Disk.isDC42使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.webcodepro.applecommander.storage.Disk
的用法示例。
在下文中一共展示了Disk.isDC42方法的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$
}