Commit correct patches.

Feature safe:	yes
This commit is contained in:
Alex Dupre 2010-06-29 08:26:28 +00:00
parent b0aa9c691a
commit 79901b8f62
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=257139
7 changed files with 127 additions and 30 deletions

View file

@ -0,0 +1,29 @@
--- de/tu_darmstadt/informatik/rbg/hatlak/eltorito/impl/ElToritoHandler.java 2009-03-22 13:35:13.000000000 +0100
+++ de/tu_darmstadt/informatik/rbg/hatlak/eltorito/impl/ElToritoHandler.java 2010-06-29 10:10:02.000000000 +0200
@@ -114,7 +114,7 @@
}
// Write Boot Image
- FileDataReference fdr = new FileDataReference(config.getBootImage());
+ FileDataReference fdr = new FileDataReference(config.getBootImage().getFile());
data(fdr);
super.endElement();
@@ -124,7 +124,7 @@
// Patch the Boot Image: write 56 byte boot information table
// (cf. man mkisofs, section EL TORITO BOOT INFORMATION TABLE)
try {
- String orgName = config.getBootImage().getAbsolutePath();
+ String orgName = config.getBootImage().getFile().getAbsolutePath();
File orgFile = new File(orgName);
// Compute the checksum over all 32-bit words starting at byte offset 64
@@ -173,7 +173,7 @@
buffer[i++] = (byte) ((lba>>16)&0xFF);
buffer[i++] = (byte) ((lba>>24)&0xFF);
// Boot file length in bytes, 7.3.1 format
- int len = (int) config.getBootImage().getAbsoluteFile().length();
+ int len = (int) config.getBootImage().getFile().getAbsoluteFile().length();
buffer[i++] = (byte) (len&0xFF);
buffer[i++] = (byte) ((len>>8)&0xFF);
buffer[i++] = (byte) ((len>>16)&0xFF);

View file

@ -1,22 +1,57 @@
--- de/tu_darmstadt/informatik/rbg/hatlak/iso9660/ISO9660File.java 2007-03-30 17:06:58.000000000 +0200
+++ de/tu_darmstadt/informatik/rbg/hatlak/iso9660/ISO9660File.java 2010-06-29 09:23:34.000000000 +0200
@@ -265,7 +265,7 @@
this.enforceDotDelimiter = force;
+++ de/tu_darmstadt/informatik/rbg/hatlak/iso9660/ISO9660File.java 2010-06-29 10:10:52.000000000 +0200
@@ -29,8 +29,9 @@
/**
* Note: this class has a natural ordering that is inconsistent with equals.
*/
-public class ISO9660File extends File implements ISO9660HierarchyObject {
+public class ISO9660File implements ISO9660HierarchyObject {
public static final Pattern FILEPATTERN = Pattern.compile("^([^.]+)\\.(.+)$");
+ private File file;
private boolean enforceDotDelimiter = false;
private static final long serialVersionUID = 1L;
private String filename, extension;
@@ -47,7 +48,7 @@
* @throws HandlerException Invalid File version or file is a directory
*/
public ISO9660File(File file, int version) throws HandlerException {
- super(file.getPath());
+ this.file = file;
setName(file.getName());
setVersion(version);
id = new Object();
@@ -67,8 +68,8 @@
* @throws HandlerException Invalid File version or file is a directory
*/
public ISO9660File(String pathname, int version) throws HandlerException {
- super(pathname);
- setName(super.getName());
+ file = new File(pathname);
+ setName(file.getName());
setVersion(version);
id = new Object();
enforce8plus3 = false;
@@ -99,6 +100,10 @@
this(pathname, 1);
}
- public int compareTo(Object object) throws ClassCastException, NullPointerException {
+ public int compareTo(File object) throws ClassCastException, NullPointerException {
// Alphanumerical case-insensitive sort (according to ISO9660 needs)
if (object==null) {
throw new NullPointerException();
@@ -292,10 +292,6 @@
} // else: Compare extensions
+ public File getFile() {
+ return file;
+ }
+
/**
* Returns the name of the file (without dot)
*
@@ -133,7 +138,11 @@
} // else
return getExtension().toUpperCase().compareTo(file.getExtension().toUpperCase());
- } else
- if (object instanceof ISO9660Directory) {
- ISO9660Directory dir = (ISO9660Directory) object;
- return getFullName().toUpperCase().compareTo(dir.getName().toUpperCase());
} else {
throw new ClassCastException();
}
return filename;
- }
+ }
+
+ public boolean isDirectory() {
+ return file.isDirectory();
+ }
/**
* Declare this file to be a moved directory "totem pole"

View file

@ -1,11 +0,0 @@
--- de/tu_darmstadt/informatik/rbg/hatlak/iso9660/ISO9660HierarchyObject.java 2007-03-30 17:06:58.000000000 +0200
+++ de/tu_darmstadt/informatik/rbg/hatlak/iso9660/ISO9660HierarchyObject.java 2010-06-29 09:24:25.000000000 +0200
@@ -19,7 +19,7 @@
package de.tu_darmstadt.informatik.rbg.hatlak.iso9660;
-public interface ISO9660HierarchyObject extends Cloneable, Comparable {
+public interface ISO9660HierarchyObject extends Cloneable {
/**
* Returns the name of the hierarchy object
*

View file

@ -0,0 +1,11 @@
--- de/tu_darmstadt/informatik/rbg/hatlak/iso9660/NamingConventions.java 2007-03-30 17:06:58.000000000 +0200
+++ de/tu_darmstadt/informatik/rbg/hatlak/iso9660/NamingConventions.java 2010-06-29 10:12:14.000000000 +0200
@@ -178,7 +178,7 @@
// First try to append the number
ISO9660File copy = null;
try {
- copy = new ISO9660File(file);
+ copy = new ISO9660File(file.getFile());
} catch (HandlerException e) {
e.printStackTrace();
}

View file

@ -0,0 +1,11 @@
--- de/tu_darmstadt/informatik/rbg/hatlak/iso9660/impl/FileHandler.java 2007-03-30 17:06:58.000000000 +0200
+++ de/tu_darmstadt/informatik/rbg/hatlak/iso9660/impl/FileHandler.java 2010-06-29 10:10:17.000000000 +0200
@@ -69,7 +69,7 @@
private void doFile(ISO9660File file) throws HandlerException {
super.startElement(new FileElement(file));
- FileDataReference fdr = new FileDataReference(file);
+ FileDataReference fdr = new FileDataReference(file.getFile());
data(fdr);
super.endElement();

View file

@ -0,0 +1,11 @@
--- de/tu_darmstadt/informatik/rbg/hatlak/iso9660/impl/ISO9660Factory.java 2007-03-30 17:06:58.000000000 +0200
+++ de/tu_darmstadt/informatik/rbg/hatlak/iso9660/impl/ISO9660Factory.java 2010-06-29 10:11:08.000000000 +0200
@@ -322,7 +322,7 @@
// Write and close Length Fixup
Fixup dataLengthFixup = (Fixup) memory.get("drDataLengthFixup");
- dataLengthFixup.data(new BothWordDataReference(file.length()));
+ dataLengthFixup.data(new BothWordDataReference(file.getFile().length()));
dataLengthFixup.close();
return memory;

View file

@ -0,0 +1,11 @@
--- de/tu_darmstadt/informatik/rbg/hatlak/iso9660/impl/ISO9660RockRidgeFactory.java 2007-03-30 17:06:58.000000000 +0200
+++ de/tu_darmstadt/informatik/rbg/hatlak/iso9660/impl/ISO9660RockRidgeFactory.java 2010-06-29 10:11:23.000000000 +0200
@@ -160,7 +160,7 @@
rripFactory.doPXEntry(fileModes, 1, 0, 0, 1);
// TF: Timestamp
- ISO9660ShortDateDataReference date = new ISO9660ShortDateDataReference(file.lastModified());
+ ISO9660ShortDateDataReference date = new ISO9660ShortDateDataReference(file.getFile().lastModified());
rripFactory.doTFEntry(RRIPFactory.TF_MODIFY, date);
// Compute length up to here