1 /* 2 * #%L 3 * nom.tam FITS library 4 * %% 5 * Copyright (C) 2004 - 2024 nom-tam-fits 6 * %% 7 * This is free and unencumbered software released into the public domain. 8 * 9 * Anyone is free to copy, modify, publish, use, compile, sell, or 10 * distribute this software, either in source code form or as a compiled 11 * binary, for any purpose, commercial or non-commercial, and by any 12 * means. 13 * 14 * In jurisdictions that recognize copyright laws, the author or authors 15 * of this software dedicate any and all copyright interest in the 16 * software to the public domain. We make this dedication for the benefit 17 * of the public at large and to the detriment of our heirs and 18 * successors. We intend this dedication to be an overt act of 19 * relinquishment in perpetuity of all present and future rights to this 20 * software under copyright law. 21 * 22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 28 * OTHER DEALINGS IN THE SOFTWARE. 29 * #L% 30 */ 31 32 package nom.tam.fits; 33 34 /** 35 * The string value does not fit into a signle 80-character wide FITS header 36 * record, and the library does not have long string support enabled at present. 37 * 38 * @author Attila Kovacs 39 * @see FitsFactory#setLongStringsEnabled(boolean) 40 * @since 1.16 41 */ 42 public class LongStringsNotEnabledException extends HeaderCardException { 43 44 /** 45 * 46 */ 47 private static final long serialVersionUID = -6255591057669953444L; 48 49 private static String getMessage(String key) { 50 return "Long string support is not enabled for [" + key + "]" + "\n\n --> Try FitsFactory.setLongStringsEnabled(true).\n"; 51 } 52 53 /** 54 * Instantiates a new exception for when a string value does not fit in a 55 * single 80-character header record, and support for the standard long 56 * string convention has not been enabled. 57 * 58 * @param key 59 * the header keyword for which the exception occurred. 60 */ 61 public LongStringsNotEnabledException(String key) { 62 super(getMessage(key)); 63 } 64 65 }