/** * Checks for remote existence of local item. * * @param localItem * @param request * @return * @throws RemoteAccessException * @throws StorageException */ protected boolean doCheckRemoteItemExistence( StorageItem localItem, ResourceStoreRequest request ) throws RemoteAccessException, RemoteStorageException { if ( localItem != null ) { return getRemoteStorage().containsItem( localItem.getModified(), this, request ); } else { return getRemoteStorage().containsItem( this, request ); } }
@Override protected boolean isRemoteStorageReachable(final ResourceStoreRequest request) throws StorageException, RemoteAuthenticationNeededException, RemoteAccessDeniedException { // For p2 repositories, the root URL may not be reachable, // so we test if we can reach one of the "standard" p2 repository metadata files. for (final String metadataFilePath : P2Constants.METADATA_FILE_PATHS) { log.debug( "isRemoteStorageReachable: RepositoryId=" + getId() + ": Trying to access " + metadataFilePath); request.setRequestPath(metadataFilePath); try { // We cannot use getRemoteStorage().isReachable() here because that forces the request path to be "/" if (getRemoteStorage().containsItem(this, request)) { log.debug( "isRemoteStorageReachable: RepositoryId=" + getId() + ": Successfully accessed " + metadataFilePath); return true; } } catch (final RemoteStorageException e) { log.debug( "isRemoteStorageReachable: RepositoryId=" + getId() + ": Caught exception while trying to access " + metadataFilePath, e); // rethrow and core will say _why_ it autoblocked too // everything else than RemoteStorageException will bubble up too throw e; } } return false; }