diff options
author | Nils Schwabe | 2014-07-29 15:56:57 +0200 |
---|---|---|
committer | Nils Schwabe | 2014-07-29 15:56:57 +0200 |
commit | 9c73fdd6812c3c179de0552a0fc568cb380023a0 (patch) | |
tree | 2f7de4f18a3c3d966d8fb3a6e508bb187082f923 /src/main/java/org/openslx/imagemaster/serverconnection/ImageProcessor.java | |
parent | Move scheduling interval to config and some more todos (diff) | |
download | masterserver-9c73fdd6812c3c179de0552a0fc568cb380023a0.tar.gz masterserver-9c73fdd6812c3c179de0552a0fc568cb380023a0.tar.xz masterserver-9c73fdd6812c3c179de0552a0fc568cb380023a0.zip |
Change some classes / methods to fit camelCase
Remove some ridiculous stuff
Diffstat (limited to 'src/main/java/org/openslx/imagemaster/serverconnection/ImageProcessor.java')
-rw-r--r-- | src/main/java/org/openslx/imagemaster/serverconnection/ImageProcessor.java | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/main/java/org/openslx/imagemaster/serverconnection/ImageProcessor.java b/src/main/java/org/openslx/imagemaster/serverconnection/ImageProcessor.java index ce89acd..a738259 100644 --- a/src/main/java/org/openslx/imagemaster/serverconnection/ImageProcessor.java +++ b/src/main/java/org/openslx/imagemaster/serverconnection/ImageProcessor.java @@ -11,7 +11,7 @@ import java.util.concurrent.ConcurrentHashMap; import org.apache.log4j.Logger; import org.openslx.imagemaster.Globals; -import org.openslx.imagemaster.crcchecker.CRCFile; +import org.openslx.imagemaster.crcchecker.CrcFile; import org.openslx.imagemaster.db.DbImage; import org.openslx.imagemaster.db.DbUser; import org.openslx.imagemaster.thrift.iface.DownloadInfos; @@ -83,7 +83,7 @@ public class ImageProcessor DbImage i; boolean isUpdate = false; - if ( ( i = DbImage.getImageByUUID( imageData.uuid ) ) != null ) { + if ( ( i = DbImage.getImageByUuid( imageData.uuid ) ) != null ) { // image is already available // is the client updating?? if ( imageData.imageVersion <= i.imageVersion ) { @@ -107,13 +107,13 @@ public class ImageProcessor // check if image is already uploading if ( ( image = uploadingImages.get( uuid ) ) != null ) { if ( image.getCrcFile() == null ) { - CRCFile crcFile; + CrcFile crcFile; try { // try to write crc file ... - crcFile = CRCFile.writeCrcFile( crcSums, Globals.getImageDir() + "/" + uuid + ".crc" ); + crcFile = CrcFile.writeCrcFile( crcSums, Globals.getImageDir() + "/" + uuid + ".crc" ); } catch ( IOException e ) { // ... and keep it in ram if it fails - crcFile = new CRCFile( crcSums ); + crcFile = new CrcFile( crcSums ); } image.setCrcFile( crcFile ); } @@ -129,7 +129,7 @@ public class ImageProcessor if ( DbImage.exists( imageData.uuid ) ) { throw new ImageDataException( ImageDataError.INVALID_DATA, "UUID already existing." ); } - if ( !CRCFile.sumsAreValid( crcSums ) ) + if ( !CrcFile.sumsAreValid( crcSums ) ) throw new UploadException( UploadError.INVALID_CRC, "CRC sums were invalid." ); filepath = Globals.getImageDir() + "/" + uuid + ".vmdk"; // TODO: needs to be saved in another way... (Because of the versions.) token = RandomString.generate( 100, false ); @@ -139,13 +139,13 @@ public class ImageProcessor uploadingImages.put( uuid, image ); } - CRCFile crcFile; + CrcFile crcFile; try { // try to write crc file ... - crcFile = CRCFile.writeCrcFile( crcSums, Globals.getImageDir() + "/" + uuid + ".crc" ); //TODO: same here ^ + crcFile = CrcFile.writeCrcFile( crcSums, Globals.getImageDir() + "/" + uuid + ".crc" ); //TODO: same here ^ } catch ( IOException e ) { // ... and keep it in ram if it fails - crcFile = new CRCFile( crcSums ); + crcFile = new CrcFile( crcSums ); } image.setCrcFile( crcFile ); @@ -185,7 +185,7 @@ public class ImageProcessor // server was downloading another image and now gets a new connection for this new download String token = RandomString.generate( 100, false ); - String filepath = DbImage.getImageByUUID( uuid ).imagePath; + String filepath = DbImage.getImageByUuid( uuid ).imagePath; ConnectionHandler.addConnection( token, filepath, Connection.DOWNLOADING ); client.addDownload( uuid, requestedBlocks, token ); @@ -196,7 +196,7 @@ public class ImageProcessor // insert new client and start listener synchronized ( downloadingClients ) { String token = RandomString.generate( 100, false ); - String filepath = DbImage.getImageByUUID( uuid ).imagePath; + String filepath = DbImage.getImageByUuid( uuid ).imagePath; DownloadingClient client = new DownloadingClient(); client.addDownload( uuid, requestedBlocks, token ); @@ -308,7 +308,7 @@ public class ImageProcessor for ( DbImage image : list ) { UploadingImage infos = new UploadingImage( image.token, image.blockStatus, image.timestamp.getTime(), image.uuid, image.imagePath ); ConnectionHandler.addConnection( image.token, image.imagePath, Connection.UPLOADING ).image = infos; - CRCFile crcFile = new CRCFile( Globals.getImageDir() + "/" + image.uuid + ".crc" ); // TODO: has to be adjusted with the corresponding value above + CrcFile crcFile = new CrcFile( Globals.getImageDir() + "/" + image.uuid + ".crc" ); // TODO: has to be adjusted with the corresponding value above try { if ( !crcFile.isValid() ) { continue; |