This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AmazonS3TestClient extends AmazonS3Client { | |
private static Log log = LogFactory.getLog(AmazonS3TestClient.class); | |
String testBucketName = "yourBucketName"; | |
public AmazonS3TestClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration) { | |
super(new StaticCredentialsProvider(awsCredentials), clientConfiguration); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.net.InetAddress; | |
import java.net.UnknownHostException; | |
public class IPRangeChecker { | |
public static long ipToLong(InetAddress ip) { | |
byte[] octets = ip.getAddress(); | |
long result = 0; | |
for (byte octet : octets) { | |
result <<= 8; |