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 outputIOException
public void writeAssignment(String name, String value) throws IOException
name
- assignment keyvalue
- assignment valueIOException
public void writeComment(String comment) throws IOException
comment
- comment textIOException
public void writeLine() throws IOException
IOException
protected void writeLine(String line) throws IOException
line
- line to writeIOException
public void close() throws IOException
IOException
public static void setLockPermissions(File file) throws IOException
file
- file to set access permissions onIOException
Copyright © 2008–2024. All rights reserved.