Modifier and Type | Field and Description |
---|---|
static char[] |
ILLEGAL_FILENAME_CHARACTERS
Characters that are not legal as filename (control characters are filtered separately)
|
Modifier and Type | Method and Description |
---|---|
static String |
createSanitizedFilename(StreamDescriptor descriptor,
String fallbackFilename)
Utility method for retrieving a sanitized filename out of the data provided in the stream
descriptor.
|
static File |
dumpWithUniqueName(Stream stream,
File directory,
String fallbackFilename)
Dump the given stream.
|
public static final char[] ILLEGAL_FILENAME_CHARACTERS
public static String createSanitizedFilename(StreamDescriptor descriptor, String fallbackFilename)
Utility method for retrieving a sanitized filename out of the data provided in the stream descriptor. Definition: A sanitized name contains only a base name and an extension, but no information about paths or such.
The priority for the base name is:
StreamDescriptor.getFileName()
fallbackFilename
StreamAnalysisNode
StreamDescriptor.getFileName()
fallbackFilename
descriptor
- Contains the filename informationfallbackFilename
- is used when no other information was providedpublic static File dumpWithUniqueName(Stream stream, File directory, String fallbackFilename) throws IOException
Dump the given stream. Several considerations are made:
createSanitizedFilename(StreamDescriptor, String)
directory
directory
, it will be stored in
a new sub-directory with the stream's UUID
.stream
- The Stream
to dumpdirectory
- The top-level directory where to store the streamfallbackFilename
- A fallback filename, see
createSanitizedFilename(StreamDescriptor, String)
IOException
Copyright © 2017 levigo holding gmbh. All rights reserved.