Skip to content

Commit

Permalink
extract directoryPath from filename
Browse files Browse the repository at this point in the history
  • Loading branch information
nixlaos committed Oct 5, 2023
1 parent 39c050a commit f2531c8
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,14 @@ private void writeCarrierPlan(String filename) {
*/
@Deprecated(since = "oct'23")
public void write(String filename) {
write(filename, false, null);
write(filename, false);
}

public void write(String filename, boolean createDirectory, String directoryPath) {
//TODO: In my point of view the directoyPath in not needed, because it should be possible to get extracted from the filename.
public void write(String filename, boolean createDirectory) {
File file = new File(filename);
String directoryPath = file.getParent();

if (createDirectory) {
Objects.requireNonNull(createDirectory);
if (!directoryPath.isEmpty()) {
File dir = new File(directoryPath);
if (!dir.mkdir()) {
Expand Down

0 comments on commit f2531c8

Please sign in to comment.