Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Commit

Permalink
formating cloud client list output and fixing timezone issue
Browse files Browse the repository at this point in the history
  • Loading branch information
BuzzTroll committed Jul 12, 2010
1 parent 091e72e commit e0845a9
Showing 1 changed file with 9 additions and 3 deletions.
Expand Up @@ -37,6 +37,7 @@
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;

class CumulusInputStream
extends InputStream
Expand Down Expand Up @@ -386,7 +387,6 @@ public void downloadVM(
{
try
{
System.out.println("SSSS");
String awsAccessKey = this.args.getXferS3ID();
String baseBucketName = this.args.getS3Bucket();
String key = this.makeKey(vmName, null);
Expand Down Expand Up @@ -555,7 +555,8 @@ private void s3ObjToFileList(
if(name != null)
{
Date dt = s3Objs[i].getLastModifiedDate();
cal.setTime(dt);
cal.setTimeZone(TimeZone.getTimeZone("GMT"));
cal.setTimeInMillis(dt.getTime());

FileListing fl = new FileListing();

Expand Down Expand Up @@ -609,8 +610,13 @@ private String convertTime(
{
int hr = cal.get(Calendar.HOUR_OF_DAY);
int m = cal.get(Calendar.MINUTE);
String mStr = new Integer(m).toString();
if(mStr.length() != 2)
{
mStr = "0" + mStr;
}

return new Integer(hr).toString() + ":" + new Integer(m).toString();
return new Integer(hr).toString() + ":" + mStr;
}

public void chmod(
Expand Down

0 comments on commit e0845a9

Please sign in to comment.