Commits

Stephen Abrams committed 3ab8a68

Remove references to FileSource and ZipFileSource. Use MeasurableSource instead.

Comments (0)

Files changed (1)

src/main/java/org/jhove2/module/format/utf8/UTF8Module.java

 import org.jhove2.core.Message.Severity;
 import org.jhove2.core.format.Format;
 import org.jhove2.core.io.Input;
-import org.jhove2.core.source.FileSource;
 import org.jhove2.core.source.MeasurableSource;
 import org.jhove2.core.source.Source;
-import org.jhove2.core.source.ZipFileSource;
 import org.jhove2.module.format.BaseFormatModule;
 import org.jhove2.module.format.Validator;
 import org.jhove2.module.format.utf8.unicode.C0Control;
 		this.isValid = Validity.Undetermined;
 		int numErrors = 0;
 
-		long start = ((MeasurableSource) source).getStartingOffset();
-		long end = 0L;
-		if (source instanceof FileSource) {
-		    end = ((FileSource) source).getSize();
-		}
-		else if (source instanceof ZipFileSource) {
-		    end = ((ZipFileSource) source).getSize();
-		}
+		long start =         ((MeasurableSource) source).getStartingOffset();
+		long end   = start + ((MeasurableSource) source).getSize();
 		input.setPosition(start);
 
 		EOL eol = null;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.