-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Started making incoming dumper more flexible
- Loading branch information
Showing
14 changed files
with
129 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
as2-lib/src/main/java/com/helger/as2lib/util/dump/DefaultHTTPOutgoingDumperFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.helger.as2lib.util.dump; | ||
|
||
import java.io.File; | ||
import java.util.concurrent.atomic.AtomicInteger; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
import com.helger.as2lib.message.IBaseMessage; | ||
|
||
/** | ||
* Default implementation of {@link IHTTPOutgoingDumperFactory}. Extracted as a | ||
* public class in v4.4.5. | ||
* | ||
* @author Philip Helger | ||
*/ | ||
public class DefaultHTTPOutgoingDumperFactory implements IHTTPOutgoingDumperFactory | ||
{ | ||
// Counter to ensure unique filenames | ||
private final AtomicInteger m_aCounter = new AtomicInteger (0); | ||
private final File m_aDumpDirectory; | ||
|
||
public DefaultHTTPOutgoingDumperFactory (@Nonnull final File aDumpDirectory) | ||
{ | ||
m_aDumpDirectory = aDumpDirectory; | ||
} | ||
|
||
@Nonnull | ||
public IHTTPOutgoingDumper apply (@Nonnull final IBaseMessage aMsg) | ||
{ | ||
return new HTTPOutgoingDumperFileBased (new File (m_aDumpDirectory, | ||
"as2-outgoing-" + | ||
Long.toString (System.currentTimeMillis ()) + | ||
"-" + | ||
Integer.toString (m_aCounter.getAndIncrement ()) + | ||
".http")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.