/** * Determine the File to use for timestamp checking. * <p>The default implementation delegates to {@link #getFile()}. * @return the File to use for timestamp checking (never {@code null}) * @throws FileNotFoundException if the resource cannot be resolved as * an absolute file path, i.e. is not available in a file system * @throws IOException in case of general resolution/reading failures */ protected File getFileForLastModifiedCheck() throws IOException { return getFile(); }
/** * Determine the File to use for timestamp checking. * <p>The default implementation delegates to {@link #getFile()}. * @return the File to use for timestamp checking (never {@code null}) * @throws FileNotFoundException if the resource cannot be resolved as * an absolute file path, i.e. is not available in a file system * @throws IOException in case of general resolution/reading failures */ protected File getFileForLastModifiedCheck() throws IOException { return getFile(); }
/** * This implementation checks whether a File can be opened, * falling back to whether an InputStream can be opened. * This will cover both directories and content resources. */ @Override public boolean exists() { // Try file existence: can we find the file in the file system? try { return getFile().exists(); } catch (IOException ex) { // Fall back to stream existence: can we open the stream? try { getInputStream().close(); return true; } catch (Throwable isEx) { return false; } } }
/** * This implementation checks whether a File can be opened, * falling back to whether an InputStream can be opened. * This will cover both directories and content resources. */ @Override public boolean exists() { // Try file existence: can we find the file in the file system? try { return getFile().exists(); } catch (IOException ex) { // Fall back to stream existence: can we open the stream? try { getInputStream().close(); return true; } catch (Throwable isEx) { return false; } } }
/** * Determine the File to use for timestamp checking. * <p>The default implementation delegates to {@link #getFile()}. * @return the File to use for timestamp checking (never <code>null</code>) * @throws IOException if the resource cannot be resolved as absolute * file path, i.e. if the resource is not available in a file system */ protected File getFileForLastModifiedCheck() throws IOException { return getFile(); }
/** * This implementation checks whether a File can be opened, * falling back to whether an InputStream can be opened. * This will cover both directories and content resources. */ public boolean exists() { // Try file existence: can we find the file in the file system? try { return getFile().exists(); } catch (IOException ex) { // Fall back to stream existence: can we open the stream? try { InputStream is = getInputStream(); is.close(); return true; } catch (Throwable isEx) { return false; } } }
/** * Determine the File to use for timestamp checking. * <p>The default implementation delegates to {@link #getFile()}. * @return the File to use for timestamp checking (never {@code null}) * @throws FileNotFoundException if the resource cannot be resolved as * an absolute file path, i.e. is not available in a file system * @throws IOException in case of general resolution/reading failures */ protected File getFileForLastModifiedCheck() throws IOException { return getFile(); }
/** * Determine the File to use for timestamp checking. * <p>The default implementation delegates to {@link #getFile()}. * @return the File to use for timestamp checking (never <code>null</code>) * @throws IOException if the resource cannot be resolved as absolute * file path, i.e. if the resource is not available in a file system */ protected File getFileForLastModifiedCheck() throws IOException { return getFile(); }
/** * This implementation checks the length of the underlying File, * if available. * @see #getFile() */ public long contentLength() throws IOException { return getFile().length(); }
@Override @Hidden public File getFile() throws IOException { return super.getFile(); }
/** * This implementation checks whether a File can be opened, * falling back to whether an InputStream can be opened. * This will cover both directories and content resources. */ @Override public boolean exists() { // Try file existence: can we find the file in the file system? try { return getFile().exists(); } catch (IOException ex) { // Fall back to stream existence: can we open the stream? try { getInputStream().close(); return true; } catch (Throwable isEx) { return false; } } }
/** * This implementation checks whether a File can be opened, * falling back to whether an InputStream can be opened. * This will cover both directories and content resources. */ public boolean exists() { // Try file existence: can we find the file in the file system? try { return getFile().exists(); } catch (IOException ex) { // Fall back to stream existence: can we open the stream? try { InputStream is = getInputStream(); is.close(); return true; } catch (IOException ex2) { return false; } } }
/** * This implementation checks whether a File can be opened, * falling back to whether an InputStream can be opened. * This will cover both directories and content resources. */ public boolean exists() { // Try file existence: can we find the file in the file system? try { return getFile().exists(); } catch (IOException ex) { // Fall back to stream existence: can we open the stream? try { InputStream is = getInputStream(); is.close(); return true; } catch (Throwable isEx) { return false; } } }
/** * This implementation checks whether a File can be opened, * falling back to whether an InputStream can be opened. * This will cover both directories and content resources. */ @Override public boolean exists() { // Try file existence: can we find the file in the file system? try { return getFile().exists(); } catch (IOException ex) { // Fall back to stream existence: can we open the stream? try { getInputStream().close(); return true; } catch (Throwable isEx) { return false; } } }
val theScriptFile = resourceFrom.getFile(); if (theScriptFile.exists()) { LOGGER.debug("Created object instance from class [{}]", theScriptFile.getCanonicalPath());
@Override public Collection<? extends MetadataResolver> resolve(final SamlRegisteredService service) { try { val metadataLocation = service.getMetadataLocation(); LOGGER.info("Loading SAML metadata from [{}]", metadataLocation); val metadataResource = ResourceUtils.getResourceFrom(metadataLocation); val metadataFile = metadataResource.getFile(); val metadataResolver = getMetadataResolver(metadataResource, metadataFile); configureAndInitializeSingleMetadataResolver(metadataResolver, service); return CollectionUtils.wrap(metadataResolver); } catch (final Exception e) { LOGGER.error(e.getMessage(), e); } return new ArrayList<>(0); }