RemoteResourceManager { protected boolean fileExistOnRemote(String filePath) throws SSHClientException { String command = FileUtils.getFileExistsShellCommand(filePath); final String result = execute(command); return Boolean.parseBoolean(result.trim()); } RemoteResourceManager(SSHClient sshClient, String remoteResourcesDirPath, 
            String remoteResourcesDirName, String remoteSeparator);  RemoteResourceManager(SSHClient sshClient); void addResource(Resource resource); void removeResource(Resource resource); void uploadResources(); void deployResources(); void prepareResourceDirectory(); String getRemoteFile(Resource resource); static final String DEFAULT_REMOTE_RESOURCES_DIR_NAME; static final String DEFAULT_REMOTE_SEPARATOR; }
@Test public void testFileExistOnRemote() throws Exception { boolean exists = resourceManager.fileExistOnRemote( String.format("%s%s%s", resourceManager.remoteResourcesDir, resourceManager.remoteSeparator, DUMMY_RESOURCE_NAME)); assertThat(exists, is(equalTo(false))); exists = resourceManager.fileExistOnRemote( String.format("%s%s%s", resourceManager.remoteResourcesDir, resourceManager.remoteSeparator, UPLOADED_UNDEPLOYED_RESOURCE_NAME)); assertThat(exists, is(equalTo(true))); }