public RepositoryFile(
      final String fileName,
      final RepositoryFile parent,
      final byte[] data,
      final long lastModified) {
    this();
    this.fileId = UUIDUtil.getUUIDAsString();

    this.fileName = fileName;
    if (parent != null) {
      parent.addChildFile(this);
    }
    setParent(parent);
    setData(data);
    setLastModified(lastModified);
    directory = data == null;
  }
 public void removeChildFile(final RepositoryFile file) {
   getChildrenFiles().remove(file);
   file.setParent(null); // as of now this file has no parent.
 }