@Test public void testService_OverwriteTrueFileExists() throws Exception { String subDir = new GuidGenerator().getUUID().replaceAll(":", "").replaceAll("-", ""); AdaptrisMessage msg = createMessage(); WriteMetadataToFilesystem service = createService(subDir); service.setOverwriteIfExists(true); File parentDir = FsHelper.createFileReference(FsHelper.createUrlFromString(PROPERTIES.getProperty(BASE_DIR), true)); String propsFilename = parentDir.getCanonicalPath() + "/" + subDir + "/" + msg.getUniqueId(); createEmptyFile(new File(propsFilename)); execute(service, msg); Properties p = readProperties(new File(propsFilename), false); assertTrue(p.containsKey("key5")); assertEquals("v5", p.getProperty("key5")); }
public void setOverwriteIfExists(Boolean b) { overwriteIfExists = b; }
WriteMetadataToFilesystem extends ServiceImp { public void setOverwriteIfExists(Boolean b) { overwriteIfExists = b; } }
WriteMetadataToFilesystem extends ServiceImp { public void setOverwriteIfExists(Boolean b) { overwriteIfExists = b; } WriteMetadataToFilesystem();  WriteMetadataToFilesystem(MessageDrivenDestination d); }
WriteMetadataToFilesystem extends ServiceImp { public void setOverwriteIfExists(Boolean b) { overwriteIfExists = b; } WriteMetadataToFilesystem();  WriteMetadataToFilesystem(MessageDrivenDestination d); @Override void doService(AdaptrisMessage msg); FileNameCreator getFilenameCreator(); void setFilenameCreator(FileNameCreator creator); OutputStyle getOutputStyle(); void setOutputStyle(OutputStyle style); MessageDrivenDestination getDestination(); void setDestination(MessageDrivenDestination d); Boolean getOverwriteIfExists(); void setOverwriteIfExists(Boolean b); boolean overwriteIfExists(); MetadataFilter getMetadataFilter(); void setMetadataFilter(MetadataFilter filter); @Override void prepare(); }
WriteMetadataToFilesystem extends ServiceImp { public void setOverwriteIfExists(Boolean b) { overwriteIfExists = b; } WriteMetadataToFilesystem();  WriteMetadataToFilesystem(MessageDrivenDestination d); @Override void doService(AdaptrisMessage msg); FileNameCreator getFilenameCreator(); void setFilenameCreator(FileNameCreator creator); OutputStyle getOutputStyle(); void setOutputStyle(OutputStyle style); MessageDrivenDestination getDestination(); void setDestination(MessageDrivenDestination d); Boolean getOverwriteIfExists(); void setOverwriteIfExists(Boolean b); boolean overwriteIfExists(); MetadataFilter getMetadataFilter(); void setMetadataFilter(MetadataFilter filter); @Override void prepare();  }