Skip to content

Commit

Permalink
Merge pull request #733 from motech-implementations/upkeep_subscriptions
Browse files Browse the repository at this point in the history
xml location update location change
  • Loading branch information
gudipatiharitha authored Jul 23, 2018
2 parents 25680c4 + 18be9f2 commit 65fa89d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public class RchWebServiceFacadeImpl implements RchWebServiceFacade {
private static final String LOCAL_RESPONSE_DIR = "rch.local_response_dir";
private static final String REMOTE_RESPONSE_DIR = "rch.remote_response_dir";
private static final String REMOTE_RESPONSE_DIR_CSV = "rch.remote_response_dir_csv";
private static final String REMOTE_RESPONSE_DIR_XML = "rch.remote_response_dir_xml";
private static final String LOC_UPDATE_DIR_RCH = "rch.loc_update_dir";
private static final String REMOTE_RESPONSE_DIR_LOCATION = "rch.remote_response_dir_locations";
private static final String NULL = "NULL";
Expand Down Expand Up @@ -1093,6 +1094,10 @@ private File fileForLocUpdate(String fileName) {
return new File(remoteResponseFile(fileName));
}

private File fileForXmlLocUpdate(String fileName) {
return new File(remoteResponseFileForXml(fileName));
}

public String localResponseFile(String file) {
String localFile = settingsFacade.getProperty(LOCAL_RESPONSE_DIR);
localFile += localFile.endsWith("/") ? "" : "/";
Expand All @@ -1107,6 +1112,13 @@ public String remoteResponseFile(String file) {
return remoteFile;
}

public String remoteResponseFileForXml(String file) {
String remoteFile = settingsFacade.getProperty(REMOTE_RESPONSE_DIR_XML);
remoteFile += remoteFile.endsWith("/") ? "" : "/";
remoteFile += file;
return remoteFile;
}

private Long getScpTimeout() {
try {
return Long.parseLong(settingsFacade.getProperty(SCP_TIMEOUT_SETTING));
Expand Down Expand Up @@ -1247,7 +1259,7 @@ public int compare(RchImportFacilitator m1, RchImportFacilitator m2) {

for (RchImportFacilitator rchImportFile : rchImportFiles
) {
File remoteResponseFile = fileForLocUpdate(rchImportFile.getFileName());
File remoteResponseFile = fileForXmlLocUpdate(rchImportFile.getFileName());

if (remoteResponseFile.exists() && !remoteResponseFile.isDirectory()) {

Expand Down
3 changes: 3 additions & 0 deletions rch/src/main/resources/rch.properties
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ rch.local_response_dir=/usr/local/RCH/rch-records-local
#remote directory where RCH response file should be copied to
rch.remote_response_dir=/usr/local/RCH/rch-records-remote

#remote directory where RCH response file should be copied to
rch.remote_response_dir_xml =/usr/local/RCH/rch-records-remote/xml

#remote directory where RCH response file should be copied to
rch.remote_response_dir_csv =/usr/local/RCH/rch-records-remote/csv

Expand Down

0 comments on commit 65fa89d

Please sign in to comment.