summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java
diff options
context:
space:
mode:
authorSimon Rettberg2014-08-18 12:28:02 +0200
committerSimon Rettberg2014-08-18 12:28:02 +0200
commit6285288e0d5df6097012cd4af3dea3aaf1b8a869 (patch)
treebd6398c8ec9db8777863a96094dc93e95bf7404e /src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java
parentException handling. (diff)
downloadsatellite-daemon-6285288e0d5df6097012cd4af3dea3aaf1b8a869.tar.gz
satellite-daemon-6285288e0d5df6097012cd4af3dea3aaf1b8a869.tar.xz
satellite-daemon-6285288e0d5df6097012cd4af3dea3aaf1b8a869.zip
CRCFile -> CrcFile
Diffstat (limited to 'src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java')
-rw-r--r--src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java b/src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java
index efd5357..2f0ef46 100644
--- a/src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java
+++ b/src/main/java/org/openslx/satellitedaemon/filetransfer/ThriftConnection.java
@@ -17,7 +17,7 @@ import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
-import org.openslx.imagemaster.crcchecker.CRCFile;
+import org.openslx.imagemaster.crcchecker.CrcFile;
import org.openslx.imagemaster.thrift.iface.AuthorizationError;
import org.openslx.imagemaster.thrift.iface.AuthorizationException;
import org.openslx.imagemaster.thrift.iface.DownloadInfos;
@@ -48,7 +48,7 @@ public class ThriftConnection
private static ImageServer.Client client = null;
private static ServerSessionData sSD = null;
private static Logger log = Logger.getLogger( ThriftConnection.class );
- private static CRCFile crc = null;
+ private static CrcFile crc = null;
/***********************************************************************************************/
/**
@@ -75,13 +75,13 @@ public class ThriftConnection
// .submitImage needs the List<Integer> from CRCFile.getCRCs() only
// on the first time called. null afterwards.
log.info( "First call of submitImage following..." );
- crc = new CRCFile( filename );
+ crc = new CrcFile( filename );
log.info( "Made CRCFile from " + filename );
log.info( "crc.getCrcSums( ).size = " + crc.getCrcSums().size() );
-// log.info( "crc.getMasterSum() : " + crc.getMasterSum() );
-// for ( int i = 0; i < crc.getCrcSums().size() - 1; i++ ) {
-// log.info( "crc.getCRCSum() : " + crc.getCRCSum( i ) );
-// }
+ // log.info( "crc.getMasterSum() : " + crc.getMasterSum() );
+ // for ( int i = 0; i < crc.getCrcSums().size() - 1; i++ ) {
+ // log.info( "crc.getCRCSum() : " + crc.getCRCSum( i ) );
+ // }
return theClient.submitImage( sSD.sessionId, imDat, crc.getCrcSums() );
} catch ( ImageDataException e ) {
if ( e.isSetNumber() && e.getNumber().equals( ImageDataError.INVALID_DATA ) ) {
@@ -96,9 +96,9 @@ public class ThriftConnection
// TODO: Mark the Image as corrupted.
} else if ( e.getNumber().equals( UploadError.INVALID_CRC ) ) {
// The CRC sum contained errors
- crc = new CRCFile( filename );
+ crc = new CrcFile( filename );
try {
- if(!crc.isValid()){
+ if ( !crc.isValid() ) {
//TODO: Mark CRC-file as corrupted.
}
} catch ( IOException e1 ) {
@@ -173,7 +173,7 @@ public class ThriftConnection
if ( e.isSetNumber() && e.getNumber().equals( ImageDataError.INVALID_DATA ) ) {
// Data in the db is not valid
//TODO: add e.message into DB;
- } else {
+ } else {
e.printStackTrace();
}
} catch ( UploadException e ) {
@@ -183,7 +183,7 @@ public class ThriftConnection
} else if ( e.getNumber().equals( UploadError.INVALID_CRC ) ) {
// The CRC sum contained errors
try {
- if(!crc.isValid()){
+ if ( !crc.isValid() ) {
//TODO: Mark CRC-file as corrupted.
}
} catch ( IOException e1 ) {
@@ -261,7 +261,7 @@ public class ThriftConnection
} else {
e.printStackTrace();
}
- } catch ( AuthorizationException e ) {
+ } catch ( AuthorizationException e ) {
if ( e.isSetNumber() && e.getNumber().equals( AuthorizationError.NOT_AUTHENTICATED ) ) {
// SessionID is not valid
// TODO: Code for new SSID