code: @Override
      public String getPublicPathFromRealFile(String publicRoot, File file) throws IOException, NotAllowedException {
          String actualFilePath = file.getCanonicalPath();
          File rootFile = galleryAuthorizationService.getRootPathsForCurrentUser().get(publicRoot);
          String relativePath = actualFilePath.substring(rootFile.getCanonicalPath().length(), actualFilePath.length());
          StringBuilder builder = new StringBuilder();
          builder.append(publicRoot);
          builder.append(relativePath);
          String publicPath = separatorsToUnix(builder.toString());
          LOG.debug("Actual file: {}, generated public path: {}", file, publicPath);
          return publicPath;
      }
docs: A kind of inverse lookup - finding the public path given the actual file.
  <strong>NOTE! This method does NOT verify that the current user actually
  has the right to access the given publicRoot! It is the responsibility of
  calling methods to make sure only allowed root paths are used.</strong>
  
  @param publicRoot
  @param file
  @return The public path of the given file for the given publicRoot.
  @throws IOException
  @throws NotAllowedException