Create new mailbox account

Report a typo

Imagine that you are working on a mail service development. Among other things, you need a method to create a new mailbox account. Here it is:

1  public void createMailbox(String username) throws IOException {
2      String pathToUnread = username + File.separator + "unread";
3
4      File unreadDirectory = new File(pathToUnread);
5      unreadDirectory.__;
6
7      File greetingMsg = new File(pathToUnread + File.separator + "greeting.msg");
8      greetingMsg.createNewFile();
9      writeGreeting(greetingMsg, username); // writes greeting template to the file
10 }

The method creates the following file structure: ${username}/unread/greeting.msg, where:

  • username directory is a home directory for a new user account
  • unread directory is a directory with unread messages
  • greeting.msg is the first user's message with some useful information for a quick start

Fill in the gap in the 5th line to make the method work properly.

Enter a short text
___

Create a free account to access the full topic