Creates a list of TIFF image files from a list of <code>IIOImage</code>
objects.

@param imageList a list of <code>IIOImage</code> objects
@param index an index of the page; -1 means all pages
@return a list of TIFF image files
@throws IOException
181882
public static List<File> createTiffFiles(List<IIOImage> imageList, int index) throws IOException {
        return createTiffFiles(imageList, index, 0, 0);
    }
59530
public static void merge(List<File> inputFiles, File outputFile) throws IOException {
        ImageOutputStream output = null;
        try {
            output = ImageIO.createImageOutputStream(outputFile);

            for (File file : inputFiles) {
                ImageInputStream input = null;
                try {
                    input = ImageIO.createImageInputStream(file);
                    List<TIFFPage> pages = getPages(input);
                    writePages(output, pages);
                }
                finally {
                    if (input != null) {
                        input.close();
                    }
                }
            }
        }
        finally {
            if (output != null) {
                output.flush();
                output.close();
            }
        }
    }
1267536
def _read_image_list(self, skip_image_ids=None):
    """"""
    if skip_image_ids is None:
      skip_image_ids = []
    images = self._storage_client.list_blobs(
        prefix=os.path.join('dataset', self._dataset_name) + '/')
    zip_files = [i for i in images if i.endswith('.zip')]
    if len(zip_files) == 1:
      # we have a zip archive with images
      zip_name = zip_files[0]
      logging.info('Reading list of images from zip file %s', zip_name)
      blob = self._storage_client.get_blob(zip_name)
      buf = BytesIO()
      logging.info('Downloading zip')
      blob.download_to_file(buf)
      buf.seek(0)
      logging.info('Reading content of the zip')
      with zipfile.ZipFile(buf) as f:
        images = [os.path.join(zip_name, os.path.basename(n))
                  for n in f.namelist() if n.endswith('.png')]
      buf.close()
      logging.info('Found %d images', len(images))
    else:
      # we have just a directory with images, filter non-PNG files
      logging.info('Reading list of images from png files in storage')
      images = [i for i in images if i.endswith('.png')]
      logging.info('Found %d images', len(images))
    # filter images which should be skipped
    images = [i for i in images
              if os.path.basename(i)[:-4] not in skip_image_ids]
    # assign IDs to images
    images = [(DATASET_IMAGE_ID_PATTERN.format(idx), i)
              for idx, i in enumerate(sorted(images))]
    return images
1082623
public Object opt(int index) {
    return (index < 0 || index >= length()) ? null : this.myArrayList.get(index);
  }
406843
public int[][] fromFile(File file) throws IOException {
        BufferedImage image = ImageIO.read(file);
        image = scalingIfNeed(image, true);
        return toIntArrayArray(image);
    }
1031435
@Override
   public void loadTiff(InputStream tiff, ImageProcessor imageProcessor, int... pages) throws VectorPrintException {
      File f = null;
      try {
         f = File.createTempFile("tiff.", "tiff");
         f.deleteOnExit();
         IOHelper.load(tiff, new FileOutputStream(f), ReportConstants.DEFAULTBUFFERSIZE, true);
         loadTiff(f, imageProcessor, pages);
      } catch (IOException ex) {
         throw new VectorPrintException(String.format("unable to load tiff"), ex);
      } finally {
         if (f != null) {
            f.delete();
         }
      }
   }
820158
public static File[] listFile(File director) {
        String basePath = director.getAbsolutePath() + ValueConsts.SEPARATOR;
        String[] filePath = director.list();
        File[] files = null;
        if (Checker.isNotNull(filePath)) {
            files = new File[filePath.length];
            int i = 0;
            for (String s : filePath) {
                files[i++] = new File(basePath + s);
            }
        }
        return files;
    }
1243805
static <E> ListIterator<E> listIteratorImpl(List<E> list, int index) {
    return new AbstractListWrapper<E>(list).listIterator(index);
  }
1134826
public List<? extends Element> getMemberList(Character index) {
        SortedSet<Element> set = indexmap.get(index);
        if (set == null)
            return null;
        List<Element> out = new ArrayList<>();
        out.addAll(set);
        return out;
    }
261436
public static List<File> listFiles(File dir, FileFilter filter, boolean recursive){
		List<File> list = new ArrayList<File>();
		listFilesInternal(list, dir, filter, recursive);
		return list;
	}
64639
void copyIndex(final AbstractIndex index) throws IOException
   {
      // commit changes to directory on other index.
      index.commit(true);
      // simply copy over the files
      byte[] buffer = new byte[1024];
      Directory dir = index.getDirectory();
      Directory dest = getDirectory();
      String[] files = dir.listAll();
      for (int i = 0; i < files.length; i++)
      {
         IndexInput in = dir.openInput(files[i]);
         try
         {
            IndexOutput out = dest.createOutput(files[i]);
            try
            {
               long remaining = in.length();
               while (remaining > 0)
               {
                  int num = (int)Math.min(remaining, buffer.length);
                  in.readBytes(buffer, 0, num);
                  out.writeBytes(buffer, num);
                  remaining -= num;
               }
            }
            finally
            {
               out.close();
            }
         }
         finally
         {
            in.close();
         }
      }
   }
669802
@SuppressWarnings(UNCHECKED)
    protected List<E> list(Criteria criteria)
    {
        return new ArrayList<E>(criteria.list());
    }
712302
public ResourceFileList getResourceFileList() throws IOException {
		if(root == null) {
			throw new IOException("No prefix set");
		}
		ResourceFileList list = new ResourceFileList();
		populateFileList(list,root,recurse);
		return list;
	}
1078257
private JSONObject getImageKeyword(final JSONArray imageKeywords, final int index) {
    JSONObject object = new JSONObject();
    try {
      object = (JSONObject) imageKeywords.get(index);
    }
    catch(JSONException e) {
      e.printStackTrace();
    }
    return object;
  }
1121685
public ImageView getImage(int index) {
		if(config.commandLogging){
			Log.d(config.commandLoggingTag, "getImage("+index+")");
		}
		
		return getter.getView(ImageView.class, index);
	}
916218
public Collection<Image> addImages(File path) throws IOException {
        if (path == null) {
            throw new IllegalArgumentException("Directory path must not be null.");
        } else if (!path.exists()) {
            throw new IllegalArgumentException("The directory " + path.getCanonicalPath() + " does not exist.");
        } else if (!path.isDirectory()) {
            throw new IllegalArgumentException(path.getCanonicalPath() + " is not a directory.");
        }

        return addImagesFromPath("", path);
    }
1356408
public <T> File writeLines(Collection<T> list, boolean isAppend) throws IORuntimeException {
		return writeLines(list, null, isAppend);
	}