當前位置: 首頁>>代碼示例>>Java>>正文


Java Disk.save方法代碼示例

本文整理匯總了Java中com.webcodepro.applecommander.storage.Disk.save方法的典型用法代碼示例。如果您正苦於以下問題:Java Disk.save方法的具體用法?Java Disk.save怎麽用?Java Disk.save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.webcodepro.applecommander.storage.Disk的用法示例。


在下文中一共展示了Disk.save方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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"));
}
 
開發者ID:AppleCommander,項目名稱:AppleCommander,代碼行數:25,代碼來源:ac.java

示例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"));
}
 
開發者ID:AppleCommander,項目名稱:AppleCommander,代碼行數:25,代碼來源:ac.java

示例3: convert

import com.webcodepro.applecommander.storage.Disk; //導入方法依賴的package包/類
/**
 * Unshrink or otherwise interpret incoming data depending on what kind it is:
 * 
 * DiskCopy 4.2 image - convert it to a ProDOS image
 * SDK disk image - unpack it to a disk image
 * ShrinkIt file bundle - unpack files onto a disk image sized to fit, or as specified in numbers of blocks
 */
static void convert(String shrinkName, String imageName, int imageSize)
	throws IOException {
	Disk disk = new Disk(shrinkName, imageSize);
	disk.setFilename(imageName);
	disk.save();
}
 
開發者ID:AppleCommander,項目名稱:AppleCommander,代碼行數:14,代碼來源:ac.java

示例4: convert

import com.webcodepro.applecommander.storage.Disk; //導入方法依賴的package包/類
/**
 * Unshrink or otherwise interpret incoming data depending on what kind it is:
 * 
 * DiskCopy 4.2 image - convert it to a ProDOS image
 * SDK disk image - unpack it to a disk image
 * ShrinkIt file bundle [future] - unpack files onto a disk image sized to fit
 */
static void convert(String shrinkName, String imageName, int imageSize)
	throws IOException {
	Disk disk = new Disk(shrinkName);
	disk.setFilename(imageName);
	disk.save();
}
 
開發者ID:marvinmalkowskijr,項目名稱:applecommander,代碼行數:14,代碼來源:ac.java


注:本文中的com.webcodepro.applecommander.storage.Disk.save方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。