Location.exists
Code IndexAdd Codota to your IDE (free)

Best code snippets using loci.common.Location.exists(Showing top 20 results out of 315)

Refine search

  • Location.<init>
  • Common ways to obtain Location
private void myMethod () {
Location l =
  • Location location;location.getParentFile()
  • Location parent;new Location(parent, child)
  • Smart code suggestions by Codota
}
origin: ome/formats-bsd

private void findLogFiles() {
 iniFile = null;
 Location loc = new Location(getCurrentFile() + ".ini");
 if (loc.exists()) {
  iniFile = loc.getAbsolutePath();
 }
}
origin: ome/formats-gpl

@Override
public String[] getSeriesUsedFiles(boolean noPixels) {
 FormatTools.assertId(currentId, true, 1);
 final List<String> v = new ArrayList<String>();
 if (leiFilename != null) v.add(leiFilename);
 if (!noPixels && files != null) {
  for (Object file : files[getSeries()]) {
   if (file != null && new Location((String) file).exists()) {
    v.add((String) file);
   }
  }
 }
 return v.toArray(new String[v.size()]);
}
origin: ome/formats-bsd

@Override
public boolean isSingleFile(String id) throws FormatException, IOException {
 if (new Location(id).isDirectory() && checkSuffix(id, "fake")) {
  fakeSeries.clear();
  return listFakeSeries(id).size() <= 1;
 }
 if (checkSuffix(id, "fake" + ".ini")) {
  return ! new Location(id).exists();
 }
 return ! new Location(id + ".ini").exists();
}
origin: openmicroscopy/bioformats

@Override
public boolean isThisType(String name, boolean open) {
 if (!open) return false;
 if (checkSuffix(name, "hdr")) return super.isThisType(name, open);
 else if (checkSuffix(name, "img")) {
  String headerFile = name.substring(0, name.lastIndexOf(".")) + ".hdr";
  return new Location(headerFile).exists() && isThisType(headerFile, open);
 }
 return false;
}
origin: ome/formats-gpl

private static Location findXML(String name) {
 Location parent = new Location(name).getAbsoluteFile().getParentFile();
 Location xml = new Location(parent, XML_FILE);
 if (xml.exists()) {
  return xml;
 }
 if (parent.getParent() != null) {
  xml = new Location(parent.getParentFile(), XML_FILE);
  if (xml.exists()) {
   return xml;
  }
 }
 return null;
}
origin: openmicroscopy/bioformats

@Override
public String[] getSeriesUsedFiles(boolean noPixels) {
 FormatTools.assertId(currentId, true, 1);
 ArrayList<String> files = new ArrayList<String>();
 files.add(currentId);
 for (Plane p : planes[getSeries()]) {
  if (p != null && p.filename != null &&
   new Location(p.filename).exists())
  {
   files.add(p.filename);
  }
 }
 return files.toArray(new String[files.size()]);
}
origin: ome/formats-gpl

@Override
public boolean isThisType(String name, boolean open) {
 if (checkSuffix(name, "xys")) return true;
 // verify that there is an .xys file in the same directory
 if (name.indexOf(' ') == -1) return false;
 if (!open) return false;
 String prefix = name.substring(0, name.lastIndexOf(" "));
 Location xys = new Location(prefix + " 1.xys");
 return xys.exists();
}
origin: ome/formats-gpl

@Override
public boolean isThisType(String name, boolean open) {
 if (checkSuffix(name, "vws") || checkSuffix(name, "pst")) {
  return true;
 }
 String pstFile = name;
 if (name.indexOf('.') != -1) {
  pstFile = pstFile.substring(0, pstFile.lastIndexOf("."));
 }
 pstFile += ".pst";
 return new Location(pstFile).exists();
}
origin: ome/formats-gpl

@Override
public boolean isThisType(String name, boolean open) {
 if (checkSuffix(name, "rec") && open) {
  String base = new Location(name).getAbsoluteFile().getAbsolutePath();
  base = base.substring(0, base.lastIndexOf("."));
  String id = base + ".pcoraw";
  return new Location(id).exists();
 }
 if (checkSuffix(name, "pcoraw") && open) {
  return reader.isThisType(name, open);
 }
 return super.isThisType(name, open);
}
origin: ome/formats-gpl

@Override
public boolean isThisType(String name, boolean open) {
 String localName = new Location(name).getName();
 if (localName.equals(XML_FILE)) {
  return true;
 }
 Location parent = new Location(name).getAbsoluteFile().getParentFile();
 Location xml = new Location(parent, XML_FILE);
 if (!xml.exists()) {
  return false;
 }
 return super.isThisType(name, open);
}
origin: openmicroscopy/bioformats

@Override
public boolean isThisType(String name, boolean open) {
 if (checkSuffix(name, FV1000_SUFFIXES)) return true;
 if (!open) return false; // not allowed to touch the file system
 try {
  Location oif = new Location(findOIFFile(name));
  return oif.exists() && !oif.isDirectory() &&
   checkSuffix(oif.getAbsolutePath(), "oif") && !checkSuffix(name, "bmp");
 }
 catch (IndexOutOfBoundsException e) { }
 catch (NullPointerException e) { }
 catch (FormatException e) { }
 return false;
}
origin: openmicroscopy/bioformats

@Override
public boolean isThisType(String name, boolean open) {
 if (!super.isThisType(name, open)) return false;
 if (!open) return false;
 String baseName = name.substring(0, name.lastIndexOf("."));
 if (checkSuffix(name, "inf")) {
  return new Location(baseName + ".img").exists();
 }
 else if (checkSuffix(name, "img")) {
  return new Location(baseName + ".inf").exists();
 }
 return false;
}
origin: openmicroscopy/bioformats

@Override
public boolean isSingleFile(String id) throws FormatException, IOException {
 return !new Location(id.replaceAll(".vws", ".pst")).exists();
}
origin: openmicroscopy/bioformats

@Override
public boolean isThisType(String name, boolean open) {
 if (checkSuffix(name, "hdr")) {
  return super.isThisType(name, open);
 }
 Location file = new Location(name + ".hdr");
 if (!file.exists()) {
  return false;
 }
 return super.isThisType(file.getAbsolutePath(), open);
}
origin: openmicroscopy/bioformats

@Override
public boolean isThisType(String name, boolean open) {
 if (checkSuffix(name, "xys")) return true;
 // verify that there is an .xys file in the same directory
 if (name.indexOf(' ') == -1) return false;
 if (!open) return false;
 String prefix = name.substring(0, name.lastIndexOf(" "));
 Location xys = new Location(prefix + " 1.xys");
 return xys.exists();
}
origin: ome/formats-gpl

@Override
public boolean isThisType(String name, boolean open) {
 if (checkSuffix(name, "hdr")) {
  return super.isThisType(name, open);
 }
 Location file = new Location(name + ".hdr");
 if (!file.exists()) {
  return false;
 }
 return super.isThisType(file.getAbsolutePath(), open);
}
origin: ome/formats-gpl

@Override
public boolean isThisType(String name, boolean open) {
 if (checkSuffix(name, "xys")) return true;
 // verify that there is an .xys file in the same directory
 if (name.indexOf(' ') == -1) return false;
 if (!open) return false;
 String prefix = name.substring(0, name.lastIndexOf(" "));
 Location xys = new Location(prefix + " 1.xys");
 return xys.exists();
}
origin: openmicroscopy/bioformats

private void findLogFiles() {
 iniFile = null;
 Location loc = new Location(getCurrentFile() + ".ini");
 if (loc.exists()) {
  iniFile = loc.getAbsolutePath();
 }
}
origin: openmicroscopy/bioformats

@Override
public boolean isThisType(String name, boolean open) {
 if (checkSuffix(name, "vws") || checkSuffix(name, "pst")) {
  return true;
 }
 String pstFile = name;
 if (name.indexOf('.') != -1) {
  pstFile = pstFile.substring(0, pstFile.lastIndexOf("."));
 }
 pstFile += ".pst";
 return new Location(pstFile).exists();
}
origin: ome/formats-gpl

@Override
public boolean isThisType(String name, boolean open) {
 if (!open) return false;
 if (checkSuffix(name, "hdr")) return super.isThisType(name, open);
 else if (checkSuffix(name, "img")) {
  String headerFile = name.substring(0, name.lastIndexOf(".")) + ".hdr";
  return new Location(headerFile).exists() && isThisType(headerFile, open);
 }
 return false;
}
loci.commonLocationexists

Javadoc

Returns whether or not the pathname exists. If the pathname is a URL, then existence is determined based on whether or not we can successfully read content from the URL.

Popular methods of Location

  • <init>
  • getAbsolutePath
  • getName
    Returns the name of this file, i.e. the last name in the path name sequence.
  • getAbsoluteFile
  • getParent
    Returns the name of this file's parent directory, i.e. the path name prefix and every name in the pa
  • isDirectory
    Returns true if this pathname exists and represents a directory.
  • mapFile
    Maps the given id to the given IRandomAccess object.
  • getIdMap
    Return the id mapping.
  • list
    Return a list of all of the files in this directory. If 'noHiddenFiles' is set to true, then hidden
  • mapId
    Maps the given id to an actual filename on disk. Typically actual filenames are used for ids, making
  • getMappedFile
    Gets the random access handle for the given id.
  • getMappedId
    Gets the actual filename on disk for the given id. Typically the id itself is the filename, but in s
  • getMappedFile,
  • getMappedId,
  • getParentFile,
  • lastModified,
  • getHandle,
  • isHidden,
  • listFiles,
  • cleanStaleCacheEntries,
  • getCanonicalPath

Popular classes and methods

  • setScale (BigDecimal)
    Returns a new BigDecimal instance with the specified scale. If the new scale is greater than the old
  • setRequestProperty (URLConnection)
    Sets the value of the specified request header field. The value will only be used by the current URL
  • getSharedPreferences (Context)
  • Component (java.awt)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)