diff --git a/src/main/java/emissary/output/DropOffUtil.java b/src/main/java/emissary/output/DropOffUtil.java index 1f63bed9d3..90f8132481 100755 --- a/src/main/java/emissary/output/DropOffUtil.java +++ b/src/main/java/emissary/output/DropOffUtil.java @@ -151,16 +151,6 @@ protected void configure(final Configurator configG) { } } - /** - * This method is deprecated, the casename is ignored. Use the no-arg version - * - * @param casename ignored value - */ - @Deprecated - public String generateBuildFileName(final String casename) { - return generateBuildFileName(); - } - /** * Generate a new random build file name using the configured prefix and stragety */ @@ -654,70 +644,6 @@ public String makeDotFile(final String fullName) { return fullName.substring(0, pos + 1) + "." + fullName.substring(pos + 1); } - /** - * Get the file type from the metadata or the form string passed in - * - * @param metaData map of payload metadata - * @return the file type (also added to metaData if not present) - */ - @Deprecated - public String getFileType(final Map metaData) { - return getFileType(metaData, null); - } - - /** - * Get the file type from the metadata or the form string passed in - * - * @param metaData map of payload metadata - * @param formsArg space separated string of current forms - * @return the file type (also added to metaData if not present) - */ - @Deprecated - public String getFileType(final Map metaData, final String formsArg) { - String forms = formsArg; - if (forms == null) { - forms = metaData.get(FileTypeCheckParameter.POPPED_FORMS.getFieldName()); - if (forms == null) { - forms = ""; - } - } - - String fileType; - if (metaData.containsKey(FileTypeCheckParameter.FILETYPE.getFieldName())) { - fileType = metaData.get(FileTypeCheckParameter.FILETYPE.getFieldName()); - } else if (metaData.containsKey(FileTypeCheckParameter.FINAL_ID.getFieldName())) { - fileType = metaData.get(FileTypeCheckParameter.FINAL_ID.getFieldName()); - logger.debug("FINAL_ID FileType is ({})", fileType); - metaData.put(FileTypeCheckParameter.FILETYPE.getFieldName(), fileType); - } else { - if (forms.contains(" ")) { - fileType = forms.substring(0, forms.indexOf(" ")).trim(); - metaData.put(FileTypeCheckParameter.COMPLETE_FILETYPE.getFieldName(), forms); - } else { - fileType = forms; - } - if (StringUtils.isEmpty(fileType)) { - if (metaData.containsKey(FileTypeCheckParameter.FONT_ENCODING.getFieldName())) { - fileType = TEXT; - } else { - fileType = UNKNOWN; - } - } - - metaData.put(FileTypeCheckParameter.FILETYPE.getFieldName(), fileType); - } - - if (UNKNOWN.equals(fileType) && forms.contains("MSWORD")) { - fileType = "MSWORD_FRAGMENT"; - } - - if ("QUOTED-PRINTABLE".equals(fileType) || fileType.startsWith(PREFIXES_LANG) || fileType.startsWith("ENCODING(")) { - fileType = TEXT; - } - - return fileType; - } - /** * Get the file type from the metadata or the form string passed in * diff --git a/src/test/java/emissary/output/DropOffUtilTest.java b/src/test/java/emissary/output/DropOffUtilTest.java index 2da7e55837..421384a90e 100644 --- a/src/test/java/emissary/output/DropOffUtilTest.java +++ b/src/test/java/emissary/output/DropOffUtilTest.java @@ -21,7 +21,6 @@ import java.util.Set; import static emissary.core.Form.TEXT; -import static emissary.core.Form.UNKNOWN; import static emissary.core.constants.Parameters.EVENT_DATE; import static emissary.core.constants.Parameters.FILE_DATE; import static emissary.core.constants.Parameters.ORIGINAL_FILENAME; @@ -477,56 +476,6 @@ void testGetEventDate() { assertNull(this.util.getEventDate(d, tld)); } - @Deprecated - @Test - void testDeprecatedGetFileType() { - Map metadata = new HashMap<>(); - testDeprecatedFileType(metadata, UNKNOWN, null); - - String poppedForms = "myPoppedForms"; - setupDeprecatedMetadata(metadata, poppedForms, DropOffUtil.FileTypeCheckParameter.POPPED_FORMS); - testDeprecatedFileType(metadata, poppedForms, null); - - String formsArg = "myFile"; - setupDeprecatedMetadata(metadata, formsArg, DropOffUtil.FileTypeCheckParameter.FILETYPE); - testDeprecatedFileType(metadata, formsArg, formsArg); - - String finalId = "myFinalId"; - setupDeprecatedMetadata(metadata, finalId, DropOffUtil.FileTypeCheckParameter.FINAL_ID); - formsArg = "differentFileType"; - testDeprecatedFileType(metadata, finalId, formsArg); - - formsArg = "myFile "; - metadata.clear(); - testDeprecatedFileType(metadata, "myFile", formsArg); - assertEquals(formsArg, - metadata.get(DropOffUtil.FileTypeCheckParameter.COMPLETE_FILETYPE.getFieldName())); - - formsArg = ""; - String fontEncoding = "fontEncoding"; - setupDeprecatedMetadata(metadata, fontEncoding, DropOffUtil.FileTypeCheckParameter.FONT_ENCODING); - testDeprecatedFileType(metadata, TEXT, formsArg); - - metadata.clear(); - formsArg = " MSWORD"; - testDeprecatedFileType(metadata, "MSWORD_FRAGMENT", formsArg); - - metadata.clear(); - formsArg = "QUOTED-PRINTABLE"; - testDeprecatedFileType(metadata, TEXT, formsArg); - } - - private void setupDeprecatedMetadata(Map metadata, String fieldValue, DropOffUtil.FileTypeCheckParameter fileTypeCheckParameter) { - metadata.clear(); - metadata.put(fileTypeCheckParameter.getFieldName(), fieldValue); - } - - private void testDeprecatedFileType(Map metadata, String expectedResults, String formsArg) { - String fileType; - fileType = util.getFileType(metadata, formsArg); - assertEquals(expectedResults, fileType); - } - @Test void testGetFileType() { final IBaseDataObject bdo = new BaseDataObject();