| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
package com.drew.metadata.file; |
| 22 |
|
| 23 |
import com.drew.lang.annotations.NotNull; |
| 24 |
import com.drew.lang.annotations.Nullable; |
| 25 |
import com.drew.metadata.TagDescriptor; |
| 26 |
|
| 27 |
import static com.drew.metadata.file.FileSystemDirectory.*; |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
@SuppressWarnings("WeakerAccess") |
| 33 |
public class FileSystemDescriptor extends TagDescriptor<FileSystemDirectory> |
| 34 |
{ |
| 35 |
public FileSystemDescriptor(@NotNull FileSystemDirectory directory) |
| 36 |
{ |
| 37 |
super(directory); |
| 38 |
} |
| 39 |
|
| 40 |
@Override |
| 41 |
@Nullable |
| 42 |
public String getDescription(int tagType) |
| 43 |
{ |
| 44 |
switch (tagType) { |
| 45 |
case TAG_FILE_SIZE: |
| 46 |
return getFileSizeDescription(); |
| 47 |
default: |
| 48 |
return super.getDescription(tagType); |
| 49 |
} |
| 50 |
} |
| 51 |
|
| 52 |
@Nullable |
| 53 |
private String getFileSizeDescription() |
| 54 |
{ |
| 55 |
Long size = _directory.getLongObject(TAG_FILE_SIZE); |
| 56 |
|
| 57 |
if (size == null) |
| 58 |
return null; |
| 59 |
|
| 60 |
return Long.toString(size) + " bytes"; |
| 61 |
} |
| 62 |
} |
| 63 |
|