Hello there,
I have been looking for a method to check if a file/directory (CSFile) exists in TeamSite. Like, for regular filesystem we can use JDK exists() method for File object. I couldn't find such method in csssdk docs. I think, it's very natural to check a file exists of not. I was wondering what is the right way of doing it.
I wrote a custom method.
public boolean isCSFileExists(final String tsVPath) throws RuntimeException{
if(log.isDebugEnabled()) log.debug("checking if exists : " + tsVPath);
try {
CSVPath csvPath = new CSVPath(tsVPath);
return csClient.getFile(csvPath) != null;
}catch (CSException cse){
throw new RuntimeException(cse);
}
} But, it doesn't feel right that there is no method to check the existance of file in cssdk docs. May be I am not looking at the right place. Can anyone help me here?
Thanks
Rajesh