ucar.unidata.io.RandomAccessFile.getLocation()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(166)

本文整理了Java中ucar.unidata.io.RandomAccessFile.getLocation方法的一些代码示例,展示了RandomAccessFile.getLocation的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RandomAccessFile.getLocation方法的具体详情如下:
包路径:ucar.unidata.io.RandomAccessFile
类名称:RandomAccessFile
方法名:getLocation

RandomAccessFile.getLocation介绍

[英]Get the file location, or name.
[中]获取文件位置或名称。

代码示例

代码示例来源:origin: Unidata/thredds

  1. /**
  2. * public by accident, do not use
  3. *
  4. * @param indexRaf the open raf of the index file
  5. */
  6. void setIndexRaf(RandomAccessFile indexRaf) {
  7. this.indexRaf = indexRaf;
  8. if (indexRaf != null) {
  9. this.indexFilename = indexRaf.getLocation();
  10. }
  11. }

代码示例来源:origin: Unidata/thredds

  1. @Override
  2. public void open( RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask ) throws IOException {
  3. this.raf = raf;
  4. this.location = (raf != null) ? raf.getLocation() : null;
  5. this.ncfile = ncfile;
  6. }

代码示例来源:origin: edu.ucar/netcdf

  1. public GridIndexToNC(ucar.unidata.io.RandomAccessFile raf) {
  2. this.indexFilename = raf.getLocation();
  3. this.raf = raf;
  4. }

代码示例来源:origin: edu.ucar/cdm

  1. @Override
  2. public long getLastModified() {
  3. File file = new File(getLocation());
  4. return file.lastModified();
  5. }

代码示例来源:origin: Unidata/thredds

  1. @Override
  2. public long getLastModified() {
  3. File file = new File(getLocation());
  4. return file.lastModified();
  5. }

代码示例来源:origin: edu.ucar/netcdf

  1. @Override
  2. public long getLastModified() {
  3. File file = new File(getLocation());
  4. return file.lastModified();
  5. }

代码示例来源:origin: Unidata/thredds

  1. public File getIndexParentFile() {
  2. if (indexRaf == null) return null;
  3. Path index = Paths.get(indexRaf.getLocation());
  4. Path parent = index.getParent();
  5. return parent.toFile();
  6. }

代码示例来源:origin: Unidata/thredds

  1. public boolean isValidFile(ucar.unidata.io.RandomAccessFile raf) throws IOException {
  2. // second check the file name
  3. if (!((raf.getLocation().endsWith(".AWX") || raf.getLocation().endsWith(".awx")))) {
  4. return false;
  5. }
  6. // more serious checking
  7. return this.readPIB(raf);// not FY Satellite AWX product file
  8. }

代码示例来源:origin: edu.ucar/cdm

  1. public boolean isValidFile(RandomAccessFile raf) throws IOException {
  2. String location = raf.getLocation();
  3. if (!location.endsWith(".DEM")) return false;
  4. int pos = location.lastIndexOf('.');
  5. String stub = location.substring(0, pos);
  6. File hdrFile = new File(stub + ".HDR");
  7. return hdrFile.exists();
  8. }

代码示例来源:origin: Unidata/thredds

  1. public boolean isValidFile(RandomAccessFile raf) throws IOException {
  2. String location = raf.getLocation();
  3. if (!location.endsWith(".DEM")) return false;
  4. int pos = location.lastIndexOf('.');
  5. String stub = location.substring(0, pos);
  6. File hdrFile = new File(stub + ".HDR");
  7. return hdrFile.exists();
  8. }

代码示例来源:origin: edu.ucar/netcdf

  1. public boolean isValidFile(RandomAccessFile raf) throws IOException {
  2. String location = raf.getLocation();
  3. if (!location.endsWith(".DEM")) return false;
  4. int pos = location.lastIndexOf('.');
  5. String stub = location.substring(0, pos);
  6. File hdrFile = new File(stub + ".HDR");
  7. return hdrFile.exists();
  8. }

代码示例来源:origin: Unidata/thredds

  1. @Override
  2. public boolean syncExtend() throws IOException {
  3. boolean result = header.synchNumrecs();
  4. if (result && log.isDebugEnabled())
  5. log.debug(" N3iosp syncExtend " + raf.getLocation() + " numrecs =" + header.numrecs);
  6. return result;
  7. }

代码示例来源:origin: Unidata/thredds

  1. EmbeddedTable(Message m, RandomAccessFile raf) {
  2. this.raf = raf;
  3. this.ids = m.ids;
  4. b = new TableB("embed", raf.getLocation());
  5. d = new TableD("embed", raf.getLocation());
  6. }

代码示例来源:origin: edu.ucar/cdm

  1. @Override
  2. public boolean syncExtend() throws IOException {
  3. boolean result = header.synchNumrecs();
  4. if (result && log.isDebugEnabled())
  5. log.debug(" N3iosp syncExtend " + raf.getLocation() + " numrecs =" + header.numrecs);
  6. return result;
  7. }

代码示例来源:origin: Unidata/thredds

  1. private BufrConfig(RandomAccessFile raf) throws IOException {
  2. this.filename = raf.getLocation();
  3. try {
  4. scanBufrFile(raf);
  5. } catch (Exception e) {
  6. e.printStackTrace();
  7. throw new RuntimeException(e.getMessage());
  8. }
  9. }

代码示例来源:origin: edu.ucar/netcdf

  1. @Override
  2. public boolean syncExtend() throws IOException {
  3. boolean result = header.synchNumrecs();
  4. if (result && log.isDebugEnabled())
  5. log.debug(" N3iosp syncExtend " + raf.getLocation() + " numrecs =" + header.numrecs);
  6. return result;
  7. }

代码示例来源:origin: edu.ucar/cdm

  1. @Override
  2. public String getDetailInfo() {
  3. if (raf == null) return "";
  4. try {
  5. Formatter fout = new Formatter();
  6. double size = raf.length() / (1000.0 * 1000.0);
  7. fout.format(" raf = %s%n", raf.getLocation());
  8. fout.format(" size= %d (%s Mb)%n%n", raf.length(), Format.dfrac(size, 3));
  9. return fout.toString();
  10. } catch (IOException e) {
  11. return e.getMessage();
  12. }
  13. }

代码示例来源:origin: Unidata/thredds

  1. public static void main(String[] args) throws IOException {
  2. int count = 0;
  3. RandomAccessFile raf = new RandomAccessFile("Q:/cdmUnitTest/formats/grib2/LMPEF_CLM_050518_1200.grb", "r");
  4. System.out.printf("Read %s%n", raf.getLocation());
  5. Grib2RecordScanner scan = new Grib2RecordScanner(raf);
  6. while (scan.hasNext()) {
  7. scan.next();
  8. count++;
  9. }
  10. raf.close();
  11. System.out.printf("count=%d%n",count);
  12. }

代码示例来源:origin: Unidata/thredds

  1. public float[] getData(RandomAccessFile raf, byte[] bitmap) throws IOException {
  2. GribData.Info info = Grib1SectionBinaryData.getBinaryDataInfo(raf, startPos);
  3. boolean isGridPointData = !GribNumbers.testBitIsSet(info.flag, 1);
  4. boolean isSimplePacking = !GribNumbers.testBitIsSet(info.flag, 2);
  5. if (isGridPointData && isSimplePacking) {
  6. return readSimplePacking(raf, bitmap, info);
  7. }
  8. if (isGridPointData && !isSimplePacking) {
  9. return readExtendedComplexPacking(raf, bitmap, info);
  10. }
  11. logger.warn("Grib1BinaryDataSection: (octet 4, 1st half) not grid point data and simple packing for {}", raf.getLocation());
  12. throw new IllegalStateException("Grib1BinaryDataSection: (octet 4, 1st half) not grid point data and simple packing ");
  13. }

代码示例来源:origin: Unidata/thredds

  1. private BufrConfig(RandomAccessFile raf, Message m) throws IOException {
  2. this.filename = raf.getLocation();
  3. this.messHash = m.hashCode();
  4. this.rootConverter = new FieldConverter(m.ids.getCenterId(), m.getRootDataDescriptor());
  5. standardFields = StandardFields.extract(m);
  6. }

相关文章