Skip to content

Commit

Permalink
Parvathy | BAH-3720 | Fix. applicationDataDirectory File Path (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
parvathy00 authored Mar 29, 2024
1 parent 7408af9 commit 450a43b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ public class ApplicationDataDirectoryImpl implements ApplicationDataDirectory {

@Override
public File getFile(String relativePath) {
return new File(OpenmrsUtil.getApplicationDataDirectory() + relativePath);
String applicationDataDirectory = OpenmrsUtil.getApplicationDataDirectory();
if (!applicationDataDirectory.endsWith(File.separator)) {
applicationDataDirectory += File.separator;
}
return new File(applicationDataDirectory + relativePath);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ public void process(Event event) {

void runInterceptor(Class className, Object object) {
GroovyClassLoader gcl = new GroovyClassLoader();
File directory = new File(OpenmrsUtil.getApplicationDataDirectory() + "elisFeedInterceptor");
String applicationDataDirectory = OpenmrsUtil.getApplicationDataDirectory();
if (!applicationDataDirectory.endsWith(File.separator)) {
applicationDataDirectory += File.separator;
}
File directory = new File(applicationDataDirectory + "elisFeedInterceptor");
File[] files = directory.listFiles();
if (files != null) {
for (File file : files) {
Expand Down

0 comments on commit 450a43b

Please sign in to comment.