Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NetworkedGraphicsMV3500
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Savage
NetworkedGraphicsMV3500
Commits
295f1d58
Commit
295f1d58
authored
3 years ago
by
Brutzman, Don
Browse files
Options
Downloads
Patches
Plain Diff
handle IOException internally for simpler usage
parent
16293946
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/edu/nps/moves/dis7/utilities/stream/PduRecorder.java
+14
-8
14 additions, 8 deletions
src/edu/nps/moves/dis7/utilities/stream/PduRecorder.java
with
14 additions
and
8 deletions
src/edu/nps/moves/dis7/utilities/stream/PduRecorder.java
+
14
−
8
View file @
295f1d58
...
...
@@ -86,17 +86,23 @@ public class PduRecorder implements PduReceiver
/** Constructor to let the user specify all required parameters
*
* @param outputPath local path to the directory to write log files to
* @param multicastAddress the multicast group address to receive data from (TODO allow unicast UDP)
* @param port the port to receive data through
* @throws IOException if something goes wrong during instantiation
* @param outputDirectory local path for directory where the log files are written
* @param multicastAddress multicast group address to receive data from (TODO allow unicast UDP)
* @param port UDP port to listen for data
*/
@SuppressWarnings
(
"Convert2Lambda"
)
public
PduRecorder
(
String
output
Path
,
String
multicastAddress
,
int
port
)
throws
IOException
public
PduRecorder
(
String
output
Directory
,
String
multicastAddress
,
int
port
)
{
outputDirectoryPath
=
outputPath
;
logFile
=
createUniquePduLogFile
(
new
File
(
outputPath
).
toPath
(),
DEFAULT_FILE_PREFIX
+
DISLOG_FILE_EXTENSION
);
logFileWriter
=
new
PrintWriter
(
new
BufferedWriter
(
new
FileWriter
(
logFile
)));
try
{
Path
outputDirectoryPath
=
new
File
(
outputDirectory
).
toPath
();
logFile
=
createUniquePduLogFile
(
outputDirectoryPath
,
DEFAULT_FILE_PREFIX
+
DISLOG_FILE_EXTENSION
);
logFileWriter
=
new
PrintWriter
(
new
BufferedWriter
(
new
FileWriter
(
logFile
)));
}
catch
(
IOException
ex
)
{
System
.
err
.
println
(
"Exception when creating log file in directory="
+
outputDirectory
+
"\n"
+
" "
+
ex
.
getClass
().
getSimpleName
()
+
": "
+
ex
.
getLocalizedMessage
());
}
disThreadedNetIF
=
new
DisThreadedNetworkInterface
(
multicastAddress
,
port
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment