code: protected String toFilename(final Resource resource) throws UnsupportedOperationException {
          if (resource instanceof FileResource) {
              return ((FileResource) resource).getFile().getPath();
          }
          if (resource instanceof HadoopResource) {
              return ((HadoopResource) resource).getTemplatedPath();
          }
          if (resource instanceof HdfsResource) {
              return resource.getQualifiedPath();
          }
          if (resource instanceof UrlResource) {
              return resource.getQualifiedPath();
          }
          throw new UnsupportedOperationException("Unsupported resource type: " + resource);
      }
docs: Creates a filename string to externalize, based on a given {@link Resource}.
  
  @param resource
  @return
  @throws UnsupportedOperationException