public synchronized void startUpload(AccessStructure struct,int filesize,byte[] data) throws JPlagException {
  if (userToUploadMap.containsKey(struct.getUsername())) {
    throw new JPlagException("uploadException","You are already " + "uploading a submission!","Only one submission may be " + "uploaded by one user at a time");
  }
  File file=new File(struct.getEntryPath());
  if (file.exists()) {
    throw new JPlagException("uploadException","File already exist!?","Unable to create new file. Please tell the admins " + "about this!");
  }
  TransferObject obj=new TransferObject(struct,file,filesize,120);
  if (!obj.writeNextPart(data)) {
    userToUploadMap.put(struct.getUsername(),obj);
    uploadTimeoutQueue.add(obj);
  }
 else   JPlagCentral.addToReadyQueue(struct);
}

public synchronized void startUpload ( AccessStructure struct , int filesize , byte [ ] data ) throws JPlagException { if ( userToUploadMap . containsKey ( struct . getUsername ( ) ) ) { throw new JPlagException ( "uploadException" , "You are already " + "uploading a submission!" , "Only one submission may be " + "uploaded by one user at a time" ) ; } File file = new File ( struct . getEntryPath ( ) ) ; if ( file . exists ( ) ) { throw new JPlagException ( "uploadException" , "File already exist!?" , "Unable to create new file. Please tell the admins " + "about this!" ) ; } TransferObject obj = new TransferObject ( struct , file , filesize , 120 ) ; if ( ! obj . writeNextPart ( data ) ) { userToUploadMap . put ( struct . getUsername ( ) , obj ) ; uploadTimeoutQueue . add ( obj ) ; } else JPlagCentral . addToReadyQueue ( struct ) ; }
checks , whether the user is already uploading a submission , and if not , saves the first part of the entry file onto disk . if there are more parts , the user becomes marked as uploading and the upload is added to the upload timeout queue
