Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parvathy | BAH-3720 | Fix. Append applicationDataDirectory File Path With File Separator #257

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading