import de.todesbaum.util.io.Closer;
/**
- * Implementation of the <code>ClientPutComplexDir</code> command. This
- * command can be used to insert directories that do not exist on disk.
+ * Implementation of the <code>ClientPutComplexDir</code> command. This command
+ * can be used to insert directories that do not exist on disk.
*
* @author David Roden <droden@gmail.com>
* @version $Id$
private final String tempDirectory;
/**
- * Creates a new <code>ClientPutComplexDir</code> command with the specified identifier and URI.
- * @param identifier The identifier of the command
- * @param uri The URI of the command
+ * Creates a new <code>ClientPutComplexDir</code> command with the specified
+ * identifier and URI.
+ *
+ * @param identifier
+ * The identifier of the command
+ * @param uri
+ * The URI of the command
*/
public ClientPutComplexDir(String identifier, String uri) {
this(identifier, uri, null);
/**
* Adds a file to the directory inserted by this request.
- * @param fileEntry The file entry to add to the directory
+ *
+ * @param fileEntry
+ * The file entry to add to the directory
*/
public void addFileEntry(FileEntry fileEntry) {
if (fileEntry instanceof DirectFileEntry) {
- if (payloadFile == null){
+ if (payloadFile == null) {
try {
payloadFile = File.createTempFile("payload", ".dat", (tempDirectory != null) ? new File(tempDirectory) : null);
payloadFile.deleteOnExit();
} catch (IOException e) {
+ /* ignore. */
}
}
if (payloadFile != null) {
protected void write(Writer writer) throws IOException {
super.write(writer);
int fileIndex = 0;
- for (FileEntry fileEntry: fileEntries) {
+ for (FileEntry fileEntry : fileEntries) {
writer.write("Files." + fileIndex + ".Name=" + fileEntry.getFilename() + LINEFEED);
if (fileEntry.getContentType() != null) {
writer.write("Files." + fileIndex + ".Metadata.ContentType=" + fileEntry.getContentType() + LINEFEED);
* The received message
*/
protected void fireMessageReceived(Message message) {
- for (ConnectionListener connectionListener: connectionListeners) {
+ for (ConnectionListener connectionListener : connectionListeners) {
connectionListener.messageReceived(this, message);
}
}
* Notifies listeners about the loss of the connection.
*/
protected void fireConnectionTerminated() {
- for (ConnectionListener connectionListener: connectionListeners) {
+ for (ConnectionListener connectionListener : connectionListeners) {
connectionListener.connectionTerminated(this);
}
}