Skip to content

Commit

Permalink
Added file name length limit of 224
Browse files Browse the repository at this point in the history
  • Loading branch information
yeodonghan committed Nov 4, 2019
1 parent 9662cae commit b94bf47
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/seedu/address/logic/commands/ExportCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public CommandResult execute(Model model, CommandHistory commandHistory, UndoRed
if (!fileName.matches("[a-zA-Z0-9]+")) {
throw new CommandException("File name can only be Alphanumeric.");
}
if (fileName.length() >= 225) {
throw new CommandException("File name is too long.");
}
String dataCsv = this.getCsvString();
FileUtil.writeToFile(Paths.get(pathName), dataCsv);

Expand Down

0 comments on commit b94bf47

Please sign in to comment.