/** * Initialize the AmazonS3 client using the accessKey, secretAccessKey, sets * endpoint for the s3Client if provided * * @param accessKey * @param secretAccessKey * @param endPoint */ public void initializeS3Client(@javax.validation.constraints.NotNull String accessKey, @javax.validation.constraints.NotNull String secretAccessKey, String endPoint) { Preconditions.checkNotNull(accessKey); Preconditions.checkNotNull(secretAccessKey); s3Client = new AmazonS3Client(new BasicAWSCredentials(accessKey, secretAccessKey)); if (endPoint != null) { s3Client.setEndpoint(endPoint); } }
CachedField newCachedField (Field field, int fieldIndex, int accessIndex) { Class[] fieldClass = new Class[] {field.getType()}; Type fieldGenericType = field.getGenericType(); CachedField cachedField; if (fieldGenericType == fieldClass[0]) { // This is a field without generic type parameters if (TRACE) trace("kryo", "Field " + field.getName() + ": " + fieldClass[0]); cachedField = newMatchingCachedField(field, accessIndex, fieldClass[0], fieldGenericType, null); } else { cachedField = genericsUtil.newCachedFieldOfGenericType(field, accessIndex, fieldClass, fieldGenericType); } if (cachedField instanceof ObjectField) { hasObjectFields = true; } cachedField.field = field; cachedField.varIntsEnabled = varIntsEnabled; if (!useAsmEnabled) { cachedField.offset = unsafeUtil.getObjectFieldOffset(field); } cachedField.access = (FieldAccess)access; cachedField.accessIndex = accessIndex; cachedField.canBeNull = fieldsCanBeNull && !fieldClass[0].isPrimitive() && !field.isAnnotationPresent(NotNull.class); // Always use the same serializer for this field if the field's class is final. if (kryo.isFinal(fieldClass[0]) || fixedFieldTypes) cachedField.valueClass = fieldClass[0]; return cachedField; }
CachedField newCachedField (Field field, int fieldIndex, int accessIndex) { Class[] fieldClass = new Class[] { field.getType() }; Type fieldGenericType = field.getGenericType(); CachedField cachedField; if (fieldGenericType == fieldClass[0]) { // This is a field without generic type parameters if (TRACE) { trace("kryo", "Field '" + field.getName() + "' of type " + fieldClass[0]); } cachedField = newMatchingCachedField(field, accessIndex, fieldClass[0], fieldGenericType, null); } else { cachedField = genericsUtil.newCachedFieldOfGenericType(field, accessIndex, fieldClass, fieldGenericType); } if (cachedField instanceof ObjectField) { hasObjectFields = true; } cachedField.field = field; cachedField.varIntsEnabled = varIntsEnabled; if (!useAsmEnabled) { cachedField.offset = unsafeUtil.getObjectFieldOffset(field); } cachedField.access = (FieldAccess)access; cachedField.accessIndex = accessIndex; cachedField.canBeNull = fieldsCanBeNull && !fieldClass[0].isPrimitive() && !field.isAnnotationPresent(NotNull.class); // Always use the same serializer for this field if the field's class is final. if (kryo.isFinal(fieldClass[0]) || fixedFieldTypes) cachedField.valueClass = fieldClass[0]; return cachedField; }
/** * Set the AmazonS3 service * * @param s3Client * given s3Client */ public void setS3Client(@javax.validation.constraints.NotNull AmazonS3 s3Client) { Preconditions.checkNotNull(s3Client); this.s3Client = s3Client; }
/** * Set the bucket name * * @param bucketName * given bucketName */ public void setBucketName(@javax.validation.constraints.NotNull String bucketName) { Preconditions.checkNotNull(bucketName); this.bucketName = bucketName; }
/** * Set the bucket name where the file resides * * @param bucketName * bucket name */ public void setBucketName(@javax.validation.constraints.NotNull String bucketName) { Preconditions.checkNotNull(bucketName); this.bucketName = bucketName; }
/** * Set the access key * * @param accessKey * given accessKey */ public void setAccessKey(@javax.validation.constraints.NotNull String accessKey) { Preconditions.checkNotNull(accessKey); this.accessKey = accessKey; }
/** * Set the secretAccessKey * * @param secretAccessKey * secretAccessKey */ public void setSecretAccessKey(@javax.validation.constraints.NotNull String secretAccessKey) { Preconditions.checkNotNull(secretAccessKey); this.secretAccessKey = secretAccessKey; }