Skip to content

Commit

Permalink
Fixed a bug in the listener waiting too long to pick up files
Browse files Browse the repository at this point in the history
  • Loading branch information
datasetutil committed Dec 16, 2014
1 parent 08044b2 commit 09e1e3e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<description>Analytics Cloud Datatset Utils</description>
<artifactId>datasetutils</artifactId>
<packaging>jar</packaging>
<version>32.0.5-SNAPSHOT</version>
<version>32.0.5</version>
<url>https://github.com/forcedotcom/Analytics-Cloud-Dataset-Utils</url>
<organization>
<name>salesforce.com</name>
Expand Down Expand Up @@ -37,7 +37,7 @@
<connection>scm:git:[email protected]:forcedotcom/Analytics-Cloud-Dataset-Utils.git</connection>
<developerConnection>scm:git:[email protected]:forcedotcom/Analytics-Cloud-Dataset-Utils.git</developerConnection>
<url>scm:git:[email protected]:forcedotcom/Analytics-Cloud-Dataset-Utils.git</url>
<tag>HEAD</tag>
<tag>datasetutils-32.0.5</tag>
</scm>
<dependencies>
<dependency>
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/sforce/dataset/DatasetUtilMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ else if(args[i-1].equalsIgnoreCase("--action"))
{
action = args[i];
}
else if(args[i-1].equalsIgnoreCase("--debug"))
{
params.debug = true;
}
else if(args[i-1].equalsIgnoreCase("--inputFile"))
{
String tmp = args[i];
Expand Down Expand Up @@ -283,7 +287,7 @@ else if(args[i-1].equalsIgnoreCase("--codingErrorAction"))
if(params.username!=null || params.sessionId != null)
{
try {
partnerConnection = DatasetUtils.login(0, params.username, params.password, params.token, params.endpoint, params.sessionId);
partnerConnection = DatasetUtils.login(0, params.username, params.password, params.token, params.endpoint, params.sessionId, params.debug);
} catch (ConnectionException e) {
e.printStackTrace();
System.exit(-1);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/sforce/dataset/DatasetUtilParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@ public class DatasetUtilParams {
String Operation = null;
int rowLimit = 0;
boolean useBulkAPI = false;
boolean debug = false;
CodingErrorAction codingErrorAction = CodingErrorAction.REPORT;
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void run() {
while (!isDone) {
try
{
long cutOff = System.currentTimeMillis() - (1000*fileListener.fileAge);
long cutOff = System.currentTimeMillis() - (fileListener.fileAge);
IOFileFilter ageFilter = FileFilterUtils.ageFileFilter(cutOff);
IOFileFilter nameFilter = FileFilterUtils.nameFileFilter(fileListener.inputFilePattern, IOCase.INSENSITIVE);
// IOFileFilter suffixFileFilter1 = FileFilterUtils.suffixFileFilter(".zip", IOCase.INSENSITIVE);
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/com/sforce/dataset/util/DatasetUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ public static boolean downloadEM(String EM_NAME, PartnerConnection connection) t
}


public static PartnerConnection login(int retryCount,String username,String password, String token, String endpoint, String sessionId) throws ConnectionException {
public static PartnerConnection login(int retryCount,String username,String password, String token, String endpoint, String sessionId, boolean debug) throws ConnectionException {

if(sessionId==null)
{
Expand Down Expand Up @@ -357,7 +357,8 @@ public static PartnerConnection login(int retryCount,String username,String pass
@SuppressWarnings("unused")
GetUserInfoResult userInfo = connection.getUserInfo();
System.out.println("Service Endpoint: " + config.getServiceEndpoint());
System.out.println("SessionId Endpoint: " + config.getSessionId());
if(debug)
System.out.println("SessionId: " + config.getSessionId());
// System.out.println("User Id: " + userInfo.getUserName());
// System.out.println("User Email: " + userInfo.getUserEmail());
System.out.println();
Expand All @@ -378,7 +379,7 @@ public static PartnerConnection login(int retryCount,String username,String pass
} catch (InterruptedException e1) {
e1.printStackTrace();
}
return login(retryCount,username, password, null, endpoint, sessionId);
return login(retryCount,username, password, null, endpoint, sessionId, debug);
}
throw new ConnectionException(e.toString());
}
Expand Down

0 comments on commit 09e1e3e

Please sign in to comment.