| 1 | |
package org.jaudiotagger.logging; |
| 2 | |
|
| 3 | |
import java.text.MessageFormat; |
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | 12 | public enum ErrorMessage |
| 9 | |
{ |
| 10 | 4 | GENERAL_READ("File {0} being read"), |
| 11 | 4 | MP4_FILE_NOT_CONTAINER("This file does not appear to be an Mp4 file"), |
| 12 | 4 | MP4_FILE_NOT_AUDIO("This file does not appear to be an Mp4 Audio file, could be corrupted or video "), |
| 13 | 4 | MP4_FILE_IS_VIDEO("This file appears to be an Mp4 Video file, video files are not supported "), |
| 14 | 4 | MP4_UNABLE_TO_PRIME_FILE_FOR_WRITE_SAFETLY("Unable to safetly check consistency in Mp4 file so cancelling save"), |
| 15 | 4 | MP4_FILE_CONTAINS_MULTIPLE_DATA_ATOMS("File contains multiple data atoms"), |
| 16 | 4 | MP4_CHANGES_TO_FILE_FAILED("Unable to make changes to Mp4 file"), |
| 17 | 4 | MP4_CHANGES_TO_FILE_FAILED_NO_DATA("Unable to make changes to Mp4 file, no data was written"), |
| 18 | 4 | MP4_CHANGES_TO_FILE_FAILED_DATA_CORRUPT("Unable to make changes to Mp4 file, invalid data length has been written"), |
| 19 | 4 | MP4_CHANGES_TO_FILE_FAILED_NO_TAG_DATA("Unable to make changes to Mp4 file, no tag data has been written"), |
| 20 | 4 | MP4_CHANGES_TO_FILE_FAILED_INCORRECT_OFFSETS("Unable to make changes to Mp4 file, incorrect offsets written difference was {0}"), |
| 21 | 4 | MP4_CHANGES_TO_FILE_FAILED_CANNOT_FIND_AUDIO("Unable to make changes to Mp4 file, unable to determine start of audio"), |
| 22 | 4 | FLAC_NO_FLAC_HEADER_FOUND("Flac Header not found, not a flac file"), |
| 23 | 4 | OGG_VORBIS_NO_VORBIS_HEADER_FOUND("Cannot find vorbis setup parentHeader"), |
| 24 | 4 | MP4_REVERSE_DNS_FIELD_HAS_NO_DATA("Reverse dns field:{0} has no data"), |
| 25 | 4 | MP4_UNABLE_READ_REVERSE_DNS_FIELD("Unable to create reverse dns field because of exception:{0} adding as binary data instead"), |
| 26 | 4 | OGG_VORBIS_NO_FRAMING_BIT("The OGG Stream is not valid, Vorbis tag valid framing bit is wrong {0} "), |
| 27 | 4 | GENERAL_WRITE_FAILED("Cannot make changes to file {0}"), |
| 28 | 4 | GENERAL_WRITE_FAILED_FILE_LOCKED("Cannot make changes to file {0} because it is being used by another application"), |
| 29 | 4 | GENERAL_WRITE_FAILED_BECAUSE_FILE_IS_TOO_SMALL("Cannot make changes to file {0} because too small to be an audio file"), |
| 30 | 4 | GENERAL_WRITE_FAILED_TO_DELETE_ORIGINAL_FILE("Cannot make changes to file {0} because unable to delete the original file ready for updating from temporary file {1}"), |
| 31 | 4 | GENERAL_WRITE_FAILED_TO_RENAME_TO_ORIGINAL_FILE("Cannot make changes to file {0} because unable to rename from temporary file {1}"), |
| 32 | 4 | GENERAL_WRITE_FAILED_TO_RENAME_ORIGINAL_FILE_TO_BACKUP("Cannot make changes to file {0} because unable to rename the original file to {1}"), |
| 33 | 4 | GENERAL_WRITE_FAILED_TO_RENAME_ORIGINAL_BACKUP_TO_ORIGINAL("Unable to rename backup {0} back to file {1}"), |
| 34 | 4 | GENERAL_WRITE_FAILED_NEW_FILE_DOESNT_EXIST("New file {0} does not appear to exist"), |
| 35 | 4 | GENERAL_WRITE_FAILED_BECAUSE("Cannot make changes to file {0} because {1}"), |
| 36 | 4 | GENERAL_WRITE_FAILED_BECAUSE_FILE_NOT_FOUND("Cannot make changes to file {0} because the file cannot be found"), |
| 37 | 4 | GENERAL_WRITE_WARNING_UNABLE_TO_DELETE_BACKUP_FILE("Unable to delete the backup file {0}"), |
| 38 | 4 | GENERAL_WRITE_PROBLEM_CLOSING_FILE_HANDLE("Problem closing file handles for file {0} because {1}"), |
| 39 | 4 | GENERAL_DELETE_FAILED("Cannot delete file {0}"), |
| 40 | 4 | GENERAL_DELETE_FAILED_FILE_LOCKED("Cannot delete file {0} because it is being used by another application"), |
| 41 | 4 | GENERAL_DELETE_FAILED_BECAUSE_FILE_IS_TOO_SMALL("Cannot write to file {0} because too small to be an audio file"), |
| 42 | 4 | MP3_ID3TAG_LENGTH_INCORRECT(" {0}:Checking further because the ID3 Tag ends at {1} but the mp3 audio doesnt start until {2}"), |
| 43 | 4 | MP3_RECALCULATED_POSSIBLE_START_OF_MP3_AUDIO("{0}: Recalculated possible start of the audio to be at {1}"), |
| 44 | 4 | MP3_RECALCULATED_START_OF_MP3_AUDIO("{0}: Recalculated the start of the audio to be at {1}"), |
| 45 | 4 | MP3_START_OF_AUDIO_CONFIRMED("{0}: Confirmed audio starts at {1} whether searching from start or from end of ID3 tag"), |
| 46 | 4 | MP3_URL_SAVED_ENCODED("Url:{0} saved in encoded form as {1}"), |
| 47 | 4 | MP3_UNABLE_TO_ENCODE_URL("Unable to save url:{0} because cannot encode all characters setting to blank instead"), |
| 48 | 4 | MP4_UNABLE_TO_FIND_NEXT_ATOM_BECAUSE_IDENTIFIER_IS_INVALID("Unable to find next atom because identifier is invalid {0}"), |
| 49 | 4 | MP4_UNABLE_TO_FIND_NEXT_ATOM_BECAUSE_LENGTH_IS_INVALID("Unable to find next atom {0} because length is invalid {1}"), |
| 50 | 4 | GENERAL_INVALID_NULL_ARGUMENT("Argument cannot be null"), |
| 51 | 4 | MP4_GENRE_OUT_OF_RANGE("Genre Id {0} does not map to a valid genre"), |
| 52 | 4 | MP3_PICTURE_TYPE_INVALID("Picture Type is set to invalid value:{0}"), |
| 53 | 4 | MP3_REFERENCE_KEY_INVALID("{0}:No key could be found with the value of:{1}"), |
| 54 | 4 | MP3_UNABLE_TO_ADJUST_PADDING("Problem adjusting padding in large file, expecting to write:{0} only wrote:{1}"), |
| 55 | 4 | GENERAL_WRITE_FAILED_TO_DELETE_TEMPORARY_FILE("Unable to delete the temporary file {0}"), |
| 56 | 4 | GENERAL_WRITE_FAILED_TO_CREATE_TEMPORARY_FILE_IN_FOLDER("Cannot modify {0} because do not have permissions to create files in the folder {1}"), |
| 57 | 4 | GENERAL_WRITE_FAILED_TO_MODIFY_TEMPORARY_FILE_IN_FOLDER("Cannot modify {0} because do not have permissions to modify files in the folder {1}"), |
| 58 | 4 | GENERAL_WRITE_FAILED_TO_OPEN_FILE_FOR_EDITING("Cannot modify {0} because do not have permissions to modify file"), |
| 59 | 4 | NULL_PADDING_FOUND_AT_END_OF_MP4("Null Padding found at end of file starting at offset {0}"), |
| 60 | 4 | OGG_VORBIS_NO_SETUP_BLOCK("Could not find the Ogg Setup block"), |
| 61 | 4 | OGG_HEADER_CANNOT_BE_FOUND("OggS Header could not be found, not an ogg stream {0}"), |
| 62 | 4 | GENERAL_READ_FAILED_UNABLE_TO_CLOSE_RANDOM_ACCESS_FILE("Unable to close random access file: {0}"), |
| 63 | 4 | GENERAL_READ_FAILED_FILE_TOO_SMALL("Unable to read file because it is too small to be valid audio file: {0}"), |
| 64 | 4 | GENERAL_READ_FAILED_DO_NOT_HAVE_PERMISSION_TO_READ_FILE("Unable to read file do not have permission to read: {0}"), |
| 65 | 4 | ASF_FILE_HEADER_SIZE_DOES_NOT_MATCH_FILE_SIZE("For file {0} the File header size is {1} but different to actual file size of {2}"), |
| 66 | 4 | ASF_FILE_HEADER_MISSING("For file {0} the File Header missing. Invalid ASF/WMA file."), |
| 67 | 4 | ASF_HEADER_MISSING("For file {0} the Asf Header missing. Invalid ASF/WMA file."), |
| 68 | 4 | GENERAL_UNIDENITIFED_IMAGE_FORMAT("Cannot safetly identify the format of this image setting to default type of Png"), |
| 69 | 4 | MP4_IMAGE_FORMAT_IS_NOT_TO_EXPECTED_TYPE("ImageFormat for cover art atom is not set to a known image format, instead set to {0}"), |
| 70 | 4 | MP3_FRAME_IS_COMPRESSED("Filename {0}:{1} is compressed"), |
| 71 | 4 | MP3_FRAME_IS_ENCRYPTED("Filename {0}:{1} is encrypted"), |
| 72 | 4 | MP3_FRAME_IS_GROUPED("Filename {0}:{1} is grouped"), |
| 73 | 4 | MP3_FRAME_IS_UNSYNCHRONISED("Filename {0}:{1} is unsynchronised"), |
| 74 | 4 | MP3_FRAME_IS_DATA_LENGTH_INDICATOR("Filename {0}:{1} has a data length indicator"), |
| 75 | 4 | MP4_FILE_HAS_NO_METADATA("This file does not currently contain any metadata"), |
| 76 | 4 | MP4_FILE_META_ATOM_CHILD_DATA_NOT_NULL("Expect data in meta box to be null"), |
| 77 | 4 | WMA_INVALID_FIELD_NAME ("The field name {0} is not allowed for {1}"), |
| 78 | 4 | WMA_INVALID_LANGUAGE_USE ("The use of language {0} ist not allowed for {1} (only {2} allowed)"), |
| 79 | 4 | WMA_INVALID_STREAM_REFERNCE ("The stream number {0} is invalid. Only {1} allowed for {2}."), |
| 80 | 4 | WMA_INVALID_GUID_USE ("The use of GUID ist not allowed for {0}"), |
| 81 | 4 | WMA_LENGTH_OF_DATA_IS_TOO_LARGE("Trying to create field with {0} bytes of data but the maximum data allowed in WMA files is {1} for {2}."), |
| 82 | 4 | WMA_LENGTH_OF_LANGUAGE_IS_TOO_LARGE("Trying to create language entry, but UTF-16LE representation is {0} and exceeds maximum allowed of 255."), |
| 83 | 4 | WMA_LENGTH_OF_STRING_IS_TOO_LARGE("Trying to create field but UTF-16LE representation is {0} and exceeds maximum allowed of 65535."), |
| 84 | 4 | WMA_ONLY_STRING_IN_CD ("Only Strings are allowed in content description objects"), |
| 85 | 4 | ID3_EXTENDED_HEADER_SIZE_INVALID("{0} Invalid Extended Header Size of {0} assuming no extended header after all"), |
| 86 | 4 | ID3_EXTENDED_HEADER_SIZE_TOO_SMALL("{0} Invalid Extended Header Size of {0} is too smal to be valid"), |
| 87 | 4 | ID3_INVALID_OR_UNKNOWN_FLAG_SET("{0} Invalid or unknown bit flag 0x{1} set in ID3 tag header"), |
| 88 | 4 | ID3_TAG_UNSYNCHRONIZED("{0} the ID3 Tag is unsynchronized"), |
| 89 | 4 | ID3_TAG_EXPERIMENTAL("{0} the ID3 Tag is experimental"), |
| 90 | 4 | ID3_TAG_FOOTER("{0} the ID3 Tag is has a footer"), |
| 91 | 4 | ID3_TAG_EXTENDED("{0} the ID3 Tag is extended"), |
| 92 | 4 | ID3_TAG_CRC("{0} the ID3 Tag has crc check"), |
| 93 | 4 | ID3_TAG_COMPRESSED("{0} the ID3 Tag is compressed"), |
| 94 | 4 | ID3_TAG_CRC_SIZE("{0} According to Extended Header the ID3 Tag has crc32 of {1}"), |
| 95 | 4 | ID3_TAG_PADDING_SIZE("{0} According to Extended Header the ID3 Tag has padding size of {1}"), |
| 96 | 4 | ID_TAG_SIZE("{0} Tag size is {1} according to header (does not include header size, add 10)"), |
| 97 | 4 | ID3_TAG_CRC_FLAG_SET_INCORRECTLY("{0} CRC Data flag not set correctly."), |
| 98 | 4 | MP4_CANNOT_FIND_AUDIO("Unable to determine start of audio in file"), |
| 99 | 4 | VORBIS_COMMENT_LENGTH_TOO_LARGE("Comment field length is very large {0} , assuming comment is corrupt"), |
| 100 | 4 | VORBIS_COMMENT_LENGTH_LARGE_THAN_HEADER("Comment field length {0} is larger than total comment header {1} "), |
| 101 | 4 | ARTWORK_CANNOT_BE_CREATED_WITH_THIS_METHOD("Cover Art cannot be created using this method"), |
| 102 | 4 | ARTWORK_CANNOT_BE_RETRIEVED_WITH_THIS_METHOD("Cover Art cannot be retrieved using this method"), |
| 103 | 4 | GENERIC_NOT_SUPPORTED("Not implemented for this format"), |
| 104 | |
; |
| 105 | |
|
| 106 | |
|
| 107 | |
String msg; |
| 108 | |
|
| 109 | |
ErrorMessage(String msg) |
| 110 | 376 | { |
| 111 | 376 | this.msg = msg; |
| 112 | 376 | } |
| 113 | |
|
| 114 | |
public String getMsg() |
| 115 | |
{ |
| 116 | 2496 | return msg; |
| 117 | |
} |
| 118 | |
|
| 119 | |
public String getMsg(Object... args) |
| 120 | |
{ |
| 121 | 1983 | return MessageFormat.format(getMsg(), args); |
| 122 | |
} |
| 123 | |
|
| 124 | |
} |