public class LockWriter extends Object
| Constructor and Description |
|---|
LockWriter(OutputStream out)
Constructs a writer for writing to a given output stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the output stream.
|
static void |
setLockPermissions(File file)
Sets the permissions on a given file suitably for a SAMP Standard
Profile lockfile.
|
void |
writeAssignment(String name,
String value)
Writes a single assignment to the lockfile.
|
void |
writeAssignments(Map map)
Writes all the assignments in a given map to the lockfile.
|
void |
writeComment(String comment)
Writes a comment line to the lockfile.
|
void |
writeLine()
Writes a blank line to the lockfile.
|
protected void |
writeLine(String line)
Writes a line of text to the lockfile, terminated with a line-end.
|
public LockWriter(OutputStream out)
out - output streampublic void writeAssignments(Map map) throws IOException
map - assignment set to outputIOExceptionpublic void writeAssignment(String name, String value) throws IOException
name - assignment keyvalue - assignment valueIOExceptionpublic void writeComment(String comment) throws IOException
comment - comment textIOExceptionpublic void writeLine()
throws IOException
IOExceptionprotected void writeLine(String line) throws IOException
line - line to writeIOExceptionpublic void close()
throws IOException
IOExceptionpublic static void setLockPermissions(File file) throws IOException
file - file to set access permissions onIOExceptionCopyright © 2008–2024. All rights reserved.