public class ClientFilePathTransformer extends Object
| Constructor and Description |
|---|
ClientFilePathTransformer(com.google.common.base.Function<String,String> pathSanitizer)
Construct a new client-side file path transformer.
|
| Modifier and Type | Method and Description |
|---|---|
FsFile |
getFsFileFromClientFile(File clientFile,
int depth)
Given a client-local
File, and a path component depth,
returns the corresponding repository path. |
int |
getMinimumDepth(Collection<File> files)
Get the smallest path component depth that allows the given set of
Files
to be disambiguated. |
Set<Collection<File>> |
getTooSimilarFiles(Set<File> files)
Get the files that are too similarly named.
|
public ClientFilePathTransformer(com.google.common.base.Function<String,String> pathSanitizer)
pathSanitizer - a file-path component string transformer
whose behavior corresponds to that passed to ServerFilePathTransformer.setPathSanitizer(com.google.common.base.Function<java.lang.String, java.lang.String>) server-side.public FsFile getFsFileFromClientFile(File clientFile, int depth) throws IOException
File, and a path component depth,
returns the corresponding repository path. Must be executed client-side.clientFile - a client-local Filedepth - the path component depth (including filename)IOException - if the absolute path of the File could not be foundpublic int getMinimumDepth(Collection<File> files) throws IOException
Files
to be disambiguated. Must be executed client-side.files - a set of FilesFiles, no less than 1IOException - if the absolute path of any of the Files could not be foundpublic Set<Collection<File>> getTooSimilarFiles(Set<File> files) throws IOException
files - a set of filesnull if all the files are named sufficiently distinctlyIOException - if the absolute path of any of the Files could not be found
Version: 5.2.1-ice35-b15
Copyright © 2015 The University of Dundee & Open Microscopy Environment. All Rights Reserved.