protected OutputStream getFileLocation(DocumentHolder document) throws IOException {
Calendar calendar = Calendar.getInstance();
String constructed = "/" + (document.isImage() ? "images" : document.isAudio() ? "sounds" : document.isVideo() ? "videos" : "docs");
constructed += "/" + parser.format(calendar.getTime());
File path = new File(documentRoot, constructed);
path.mkdirs();
String identifier = System.currentTimeMillis() + "_" + StringUtils.getFilename(document.getIdentifier());
document.setUri(constructed + "/" + identifier);
path = new File(path, identifier);
path.createNewFile();
return new FileOutputStream(path);