public class PortFileManager extends Object
Modifier and Type | Method and Description |
---|---|
boolean |
addPort(Integer port)
Add a new used port
|
void |
clear()
Used for testing, simulates a new JVM
|
static PortFileManager |
getInstance()
Returns the PortFileManager instance, if it does not exists, creates a new one
|
boolean |
removePort(Integer port)
Removes a used port
|
void |
writeUsedPortFile(String filePath)
Writes a port list delimited by comma into a specified file
|
public static PortFileManager getInstance()
public boolean addPort(Integer port)
port
- a port being usedpublic boolean removePort(Integer port)
port
- a port that was used, not anymorepublic void writeUsedPortFile(String filePath) throws FileNotFoundException, IOException
filePath
- Path for the file to be writtenFileNotFoundException
IOException
public void clear()
Copyright © 2021 Hitachi Vantara. All rights reserved.