本文整理匯總了Java中com.drew.metadata.Directory.getErrors方法的典型用法代碼示例。如果您正苦於以下問題:Java Directory.getErrors方法的具體用法?Java Directory.getErrors怎麽用?Java Directory.getErrors使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.drew.metadata.Directory
的用法示例。
在下文中一共展示了Directory.getErrors方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: MetadataProcessor
import com.drew.metadata.Directory; //導入方法依賴的package包/類
public MetadataProcessor(File imageFile) {
this.imageFile = imageFile;
try {
data = ImageMetadataReader.readMetadata(imageFile);
} catch (Exception ex) {
Logger.getLogger(MetadataProcessor.class.getName()).log(Level.SEVERE, null, ex);
}
for (Directory directory : data.getDirectories()) {
extracted_data += String.format("----------------------------------------------%15s---------------------------------\n", directory.getName());
for (Tag tag : directory.getTags()) {
extracted_data += tag + "\n";
}
if (directory.hasErrors()) {
for (String error : directory.getErrors()) {
System.err.println("ERROR: " + error);
}
}
}
}
示例2: onExtractionSuccess
import com.drew.metadata.Directory; //導入方法依賴的package包/類
public void onExtractionSuccess(@NotNull File file, @NotNull Metadata metadata, @NotNull String relativePath, @NotNull PrintStream log)
{
if (metadata.hasErrors()) {
log.print(file);
log.print('\n');
for (Directory directory : metadata.getDirectories()) {
if (!directory.hasErrors())
continue;
for (String error : directory.getErrors()) {
log.printf("\t[%s] %s\n", directory.getName(), error);
_errorCount++;
}
}
}
}
示例3: onExtracted
import com.drew.metadata.Directory; //導入方法依賴的package包/類
public void onExtracted(@NotNull File file, @NotNull Metadata metadata)
{
if (metadata.hasErrors()) {
System.err.println(file);
for (Directory directory : metadata.getDirectories()) {
if (!directory.hasErrors())
continue;
for (String error : directory.getErrors()) {
System.err.printf("\t[%s] %s%n", directory.getName(), error);
_errorCount++;
}
}
}
}
示例4: outputMetadata
import com.drew.metadata.Directory; //導入方法依賴的package包/類
private static void outputMetadata(ContentHandlerHelper helper, Metadata metadata, String elementName) throws MetadataException {
if (metadata.getDirectoryCount() > 0) {
for (Iterator j = metadata.getDirectoryIterator(); j.hasNext();) {
Directory directory = (Directory) j.next();
helper.startElement(elementName, new String[]{"name", directory.getName()});
for (Iterator k = directory.getTagIterator(); k.hasNext();) {
Tag tag = (Tag) k.next();
helper.startElement(TAG_ELEMENT);
helper.element("id", tag.getTagType());
helper.element("name", tag.getTagName());
helper.element("value", tag.getDescription());
helper.endElement();
}
// TODO: Should do something with this?
if (directory.hasErrors()) {
for (Iterator k = directory.getErrors(); k.hasNext();) {
//System.out.println("ERROR: " + k.next());
}
}
helper.endElement();
}
}
}
示例5: printImageTags
import com.drew.metadata.Directory; //導入方法依賴的package包/類
private void printImageTags(int approachCount, Metadata metadata)
{
System.out.println();
System.out.println("*** APPROACH " + approachCount + " ***");
System.out.println();
// iterate over the exif data and print to System.out
Iterator directories = metadata.getDirectoryIterator();
while (directories.hasNext()) {
Directory directory = (Directory)directories.next();
Iterator tags = directory.getTagIterator();
while (tags.hasNext()) {
Tag tag = (Tag)tags.next();
System.out.println(tag);
}
if (directory.hasErrors()) {
Iterator errors = directory.getErrors();
while (errors.hasNext()) {
System.out.println("ERROR: " + errors.next());
}
}
}
}
示例6: print
import com.drew.metadata.Directory; //導入方法依賴的package包/類
private static void print(Metadata metadata)
{
System.out.println("-------------------------------------");
// Iterate over the data and print to System.out
//
// A Metadata object contains multiple Directory objects
//
for (Directory directory : metadata.getDirectories()) {
//
// Each Directory stores values in Tag objects
//
for (Tag tag : directory.getTags()) {
System.out.println(tag);
}
//
// Each Directory may also contain error messages
//
if (directory.hasErrors()) {
for (String error : directory.getErrors()) {
System.err.println("ERROR: " + error);
}
}
}
}