package transfer.upload;
import common.files.NamedFile;
import common.files.SerializableFile;
import transfer.AbstractFileTransfer;
import static main.ClientMain.*;
public class FileUpload extends AbstractFileTransfer
{
@SuppressWarnings("serial")
private static class UploadStatus extends AbstractStatus
{
public static final UploadStatus UPLOADING = new UploadStatus("uploading");
protected UploadStatus(String name)
{
super(name);
}
}
public FileUpload(SerializableFile file, FileUploadConnection connection)
{
super(new NamedFile(file, getSharedFilesTable().getFirstNameOf(file)));
setConnection(connection);
transitTo(UploadStatus.UPLOADING);
}
public void addToManager()
{
getUploadManager().addUpload(this);
}
public void removeFromManager()
{
getUploadManager().removeUpload(this);
}
}