added port as parameter
diff --git a/src/main/java/com/google/gwt/site/uploader/Credentials.java b/src/main/java/com/google/gwt/site/uploader/Credentials.java
index 8920c37..c774405 100644
--- a/src/main/java/com/google/gwt/site/uploader/Credentials.java
+++ b/src/main/java/com/google/gwt/site/uploader/Credentials.java
@@ -15,27 +15,33 @@
 
 public class Credentials {
 
-  private String host;
-  private String username;
-  private String password;
+	private String host;
+	private String username;
+	private String password;
+	private int port;
 
-  public Credentials(String host, String username, String password) {
-    this.host = host;
-    this.username = username;
-    this.password = password;
+	public Credentials(String host, int port, String username, String password) {
+		this.host = host;
+		this.port = port;
+		this.username = username;
+		this.password = password;
 
-  }
+	}
 
-  public String getHost() {
-    return host;
-  }
+	public String getHost() {
+		return host;
+	}
 
-  public String getUsername() {
-    return username;
-  }
+	public String getUsername() {
+		return username;
+	}
 
-  public String getPassword() {
-    return password;
-  }
+	public String getPassword() {
+		return password;
+	}
+
+	public int getPort() {
+		return port;
+	}
 
 }
diff --git a/src/main/java/com/google/gwt/site/uploader/Uploader.java b/src/main/java/com/google/gwt/site/uploader/Uploader.java
index dfcd2c2..134cb33 100644
--- a/src/main/java/com/google/gwt/site/uploader/Uploader.java
+++ b/src/main/java/com/google/gwt/site/uploader/Uploader.java
@@ -33,115 +33,137 @@
 
 public class Uploader {
 
-  public static void main(String[] args) {
+	public static void main(String[] args) {
 
-    if (args.length != 2) {
-      System.out.println("Usage Uploader <filesDir> <credentialsFile>");
-      throw new IllegalArgumentException("Usage Uploader <filesDir> <credentialsFile>");
-    }
+		if (args.length != 2) {
+			System.out.println("Usage Uploader <filesDir> <credentialsFile>");
+			throw new IllegalArgumentException(
+					"Usage Uploader <filesDir> <credentialsFile>");
+		}
 
-    String filesDir = args[0];
-    System.out.println("files directory: '" + filesDir + "'");
+		String filesDir = args[0];
+		System.out.println("files directory: '" + filesDir + "'");
 
-    String credentialsFile = args[1];
-    System.out.println("credentials file: '" + credentialsFile + "'");
+		String credentialsFile = args[1];
+		System.out.println("credentials file: '" + credentialsFile + "'");
 
-    FileTraverser traverser = new FileTraverser(filesDir);
-    List<MarkdownFile> markdownFiles = traverser.traverse(args[0]);
+		FileTraverser traverser = new FileTraverser(filesDir);
+		List<MarkdownFile> markdownFiles = traverser.traverse(args[0]);
 
-    Credentials credentials = readCredentialsFromFile(credentialsFile);
+		Credentials credentials = readCredentialsFromFile(credentialsFile);
 
-    String username = credentials.getUsername();
-    String password = credentials.getPassword();
-    String host = credentials.getHost();
-    RemoteApiOptions options =
-        new RemoteApiOptions().server(host, 443).credentials(username, password);
-    RemoteApiInstaller installer = new RemoteApiInstaller();
+		String username = credentials.getUsername();
+		String password = credentials.getPassword();
+		String host = credentials.getHost();
+		int port = credentials.getPort();
+		RemoteApiOptions options = new RemoteApiOptions().server(host, port)
+				.credentials(username, password);
+		RemoteApiInstaller installer = new RemoteApiInstaller();
 
-    try {
-      installer.install(options);
-      DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
+		try {
+			installer.install(options);
+			DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
 
-      for (MarkdownFile markdownFile : markdownFiles) {
-        uploadResource(ds, markdownFile);
-      }
-    } catch (IOException e) {
-      System.out.println("can not upload files");
-      throw new RuntimeException("can not upload files", e);
-    } finally {
-      installer.uninstall();
-    }
-  }
+			for (MarkdownFile markdownFile : markdownFiles) {
+				uploadResource(ds, markdownFile);
+			}
+		} catch (IOException e) {
+			System.out.println("can not upload files");
+			throw new RuntimeException("can not upload files", e);
+		} finally {
+			installer.uninstall();
+		}
+	}
 
-  private static Credentials readCredentialsFromFile(String credentialsFile) {
-    FileInputStream inputStream = null;
+	private static Credentials readCredentialsFromFile(String credentialsFile) {
+		FileInputStream inputStream = null;
 
-    try {
-      inputStream = new FileInputStream(new File(credentialsFile));
-      Properties properties = new Properties();
-      properties.load(inputStream);
-      String username = properties.getProperty("username");
-      if (username == null) {
-        System.out.println(
-            "No username found in credentials file, are you missing username=something");
-        throw new RuntimeException(
-            "No username found in credentials file, are you missing username=something");
-      }
+		try {
+			inputStream = new FileInputStream(new File(credentialsFile));
+			Properties properties = new Properties();
+			properties.load(inputStream);
+			String username = properties.getProperty("username");
+			if (username == null) {
+				System.out
+						.println("No username found in credentials file, are you missing username=something");
+				throw new RuntimeException(
+						"No username found in credentials file, are you missing username=something");
+			}
 
-      String password = properties.getProperty("password");
-      if (password == null) {
-        System.out.println(
-            "No password found in credentials file, are you missing password=something");
-        throw new RuntimeException(
-            "No password found in credentials file, are you missing password=something");
-      }
+			String password = properties.getProperty("password");
+			if (password == null) {
+				System.out
+						.println("No password found in credentials file, are you missing password=something");
+				throw new RuntimeException(
+						"No password found in credentials file, are you missing password=something");
+			}
 
-      String host = properties.getProperty("host");
-      if (host == null) {
-        System.out.println("No host found in credentials file, are you missing host=something");
-        throw new RuntimeException(
-            "No host found in credentials file, are you missing host=something");
-      }
+			String host = properties.getProperty("host");
+			if (host == null) {
+				System.out
+						.println("No host found in credentials file, are you missing host=something");
+				throw new RuntimeException(
+						"No host found in credentials file, are you missing host=something");
+			}
 
-      return new Credentials(host, username, password);
+			String portString = properties.getProperty("port");
+			if (portString == null) {
+				System.out
+						.println("No port found in credentials file, are you missing port=something");
+				throw new RuntimeException(
+						"No port found in credentials file, are you missing port=something");
+			}
+			try {
+				int port = Integer.parseInt(portString);
+				return new Credentials(host, port, username, password);
+			} catch (NumberFormatException e) {
+				System.out
+				.println("error while parsing port");
+		throw new RuntimeException(
+				"error while parsing port");
+			}
+			
 
-    } catch (IOException e) {
-      System.out.println("can not load credential files");
-      throw new RuntimeException("can not load credential files", e);
-    } finally {
-      IOUtils.closeQuietly(inputStream);
-    }
+		} catch (IOException e) {
+			System.out.println("can not load credential files");
+			throw new RuntimeException("can not load credential files", e);
+		} finally {
+			IOUtils.closeQuietly(inputStream);
+		}
 
-  }
+	}
 
-  private static void uploadResource(DatastoreService ds, MarkdownFile markdownFile)
-      throws FileNotFoundException, IOException {
+	private static void uploadResource(DatastoreService ds,
+			MarkdownFile markdownFile) throws FileNotFoundException,
+			IOException {
 
-    System.out.println("uploading file: '" + markdownFile.getPath() + "'");
+		System.out.println("uploading file: '" + markdownFile.getPath() + "'");
 
-    Entity entity = new Entity("DocModel", markdownFile.getPath().substring(1));
+		Entity entity = new Entity("DocModel", markdownFile.getPath()
+				.substring(1));
 
-    String text = null;
-    FileInputStream fileInputStream = null;
-    try {
-      fileInputStream = new FileInputStream(markdownFile.getFile());
-      if (isBinaryFile(markdownFile.getPath())) {
-        byte[] byteArray = IOUtils.toByteArray(fileInputStream);
-        text = Base64.encodeBase64String(byteArray);
-      } else {
-        text = IOUtils.toString(fileInputStream, "UTF-8");
-      }
+		String text = null;
+		FileInputStream fileInputStream = null;
+		try {
+			fileInputStream = new FileInputStream(markdownFile.getFile());
+			if (isBinaryFile(markdownFile.getPath())) {
+				byte[] byteArray = IOUtils.toByteArray(fileInputStream);
+				text = Base64.encodeBase64String(byteArray);
+			} else {
+				text = IOUtils.toString(fileInputStream, "UTF-8");
+			}
 
-      entity.setProperty("html", new Text(text));
+			entity.setProperty("html", new Text(text));
 
-      ds.put(entity);
-    } finally {
-      IOUtils.closeQuietly(fileInputStream);
-    }
-  }
+			ds.put(entity);
+		} finally {
+			IOUtils.closeQuietly(fileInputStream);
+		}
+	}
 
-  private static boolean isBinaryFile(String path) {
-    return path.endsWith(".png") || path.endsWith(".jpg") || path.endsWith(".gif");
-  }
+	private static boolean isBinaryFile(String path) {
+		return path.endsWith(".png") || path.endsWith(".jpg")
+				|| path.endsWith(".gif");
+	}
 
 }