public ResultData addAsFile(String fileName, byte[] data, int fileType, String message, boolean addTimeStampToName) { if (addTimeStampToName) { fileName = addTimeStampBeforeLastDot(fileName); } return addAsFile(fileName, data, fileType, message); }
/** * @param footerText Text to set to footer. * @return this TabularResultData * @throws ResultDataException If the value is non-finite number or if the key is null. */ @Override public TabularResultData setFooter(String footerText) { return (TabularResultData) super.setFooter(footerText); }
/** * * @return this CompositeResultData * @throws ResultDataException If the value is non-finite number or if the key is null. */ @Override public CompositeResultData setHeader(String headerText) { return (CompositeResultData) super.setHeader(headerText); }
public ResultData addAsFile(String fileName, String fileContents, String message, boolean addTimeStampToName) { return this.addAsFile(fileName, fileContents.getBytes(), FILE_TYPE_TEXT, message, addTimeStampToName); }
@Override public void saveIncomingFiles(String directory) throws IOException { // dump file data if any try { GfJsonObject content = getContent(); if (content != null) { GfJsonArray bytesArray = content.getJSONArray(ResultData.BYTE_DATA_ACCESSOR); AbstractResultData.readFileDataAndDump(bytesArray, directory); } else { throw new RuntimeException("No associated files to save .. "); } numTimesSaved = numTimesSaved + 1; } catch (DataFormatException | GfJsonException e) { throw new RuntimeException(e); } }
handleCondition(CliStrings.format( CliStrings.ABSTRACTRESULTDATA__MSG__PARENT_DIRECTORY_OF_0_DOES_NOT_EXIST, fileToDumpData.getAbsolutePath())); return; } else if (!parentDirectory.canWrite()) { handleCondition(CliStrings.format( CliStrings.ABSTRACTRESULTDATA__MSG__PARENT_DIRECTORY_OF_0_IS_NOT_WRITABLE, fileToDumpData.getAbsolutePath())); return; } else if (!parentDirectory.isDirectory()) { handleCondition( CliStrings.format(CliStrings.ABSTRACTRESULTDATA__MSG__PARENT_OF_0_IS_NOT_DIRECTORY, fileToDumpData.getAbsolutePath()));
/** * * @return this CompositeResultData * @throws ResultDataException If the value is non-finite number or if the key is null. */ @Override public CompositeResultData setFooter(String footerText) { return (CompositeResultData) super.setFooter(footerText); }
/** * @return this InfoResultData */ @Override public InfoResultData setHeader(String headerText) { return (InfoResultData) super.setHeader(headerText); }
/** * @return this InfoResultData */ @Override public InfoResultData setFooter(String footerText) { return (InfoResultData) super.setFooter(footerText); }
/** * @param headerText Text to set to header. * @return this TabularResultData * @throws ResultDataException If the value is non-finite number or if the key is null. */ @Override public TabularResultData setHeader(String headerText) { return (TabularResultData) super.setHeader(headerText); }