Tabnine Logo
ResourceReferenceUtilities.isFileSystemResource
Code IndexAdd Tabnine to your IDE (free)

How to use
isFileSystemResource
method
in
net.anwiba.commons.reference.ResourceReferenceUtilities

Best Java code snippets using net.anwiba.commons.reference.ResourceReferenceUtilities.isFileSystemResource (Showing top 5 results out of 315)

origin: net.anwiba.commons/anwiba-commons-reference

@Override
public boolean isFileSystemResource(final IResourceReference resourceReference) {
 return ResourceReferenceUtilities.isFileSystemResource(resourceReference);
}
origin: net.anwiba.commons/anwiba-commons-core

@Override
public boolean isFileSystemResource(final IResourceReference resourceReference) {
 return ResourceReferenceUtilities.isFileSystemResource(resourceReference);
}
origin: net.anwiba.commons/anwiba-commons-swing-core

private boolean isAccepted(final ImageFileFilter fileFilter, final IResourceReference imageFile) {
 try {
  if (ResourceReferenceUtilities.isFileSystemResource(imageFile)) {
   final File file = ResourceReferenceUtilities.getFile(imageFile);
   return file != null && file.isFile() && fileFilter.accept(file);
  }
  return imageFile != null;
 } catch (final URISyntaxException exception) {
  return false;
 }
}
origin: net.anwiba.commons/anwiba-commons-core

 @Override
 public IResourceReference restore(final IResourceReference resourceReference) throws IOException {
  try {
   if (!ResourceReferenceUtilities.isFileSystemResource(resourceReference)) {
    throw new IOException("Unsupported resource"); //$NON-NLS-1$
   }
   final File file = ResourceReferenceUtilities.getFile(resourceReference);
   final File backup = new File(file.getPath() + "~"); //$NON-NLS-1$
   if (backup.exists()) {
    Files.copy(backup.toPath(), file.toPath(), StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.ATOMIC_MOVE);
    if (!file.exists()) {
     throw new IOException("Coudn't restore file " + file); //$NON-NLS-1$
    }
    return new ResourceReferenceFactory().create(backup);
   }
   return null;
  } catch (final URISyntaxException exception) {
   throw new IOException(exception.getLocalizedMessage(), exception);
  }
 }
}
origin: net.anwiba.commons/anwiba-commons-reference

 @Override
 public IResourceReference restore(final IResourceReference resourceReference) throws IOException {
  try {
   if (!ResourceReferenceUtilities.isFileSystemResource(resourceReference)) {
    throw new IOException("Unsupported resource"); //$NON-NLS-1$
   }
   final File file = ResourceReferenceUtilities.getFile(resourceReference);
   final File backup = new File(file.getPath() + "~"); //$NON-NLS-1$
   if (backup.exists()) {
    Files.copy(backup.toPath(), file.toPath(), StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.ATOMIC_MOVE);
    if (!file.exists()) {
     throw new IOException("Coudn't restore file " + file); //$NON-NLS-1$
    }
    return new ResourceReferenceFactory().create(backup);
   }
   return null;
  } catch (final URISyntaxException exception) {
   throw new IOException(exception.getLocalizedMessage(), exception);
  }
 }
}
net.anwiba.commons.referenceResourceReferenceUtilitiesisFileSystemResource

Popular methods of ResourceReferenceUtilities

  • getFile
  • toString
  • getExtension
  • getPath
  • getUri
  • getUrl
  • isMemoryResource

Popular in Java

  • Finding current android device location
  • compareTo (BigDecimal)
  • getContentResolver (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • JButton (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now