List images from disk

@param folderPath string

@return array of image properties
- on success : [{url: 'url', thumb: 'thumb', name: 'name'}, ...]
- on error   : {error: 'error message'}
504592
public static function getList($folderPath, $thumbPath = null) {

    if (empty($thumbPath)) {
      $thumbPath = $folderPath;
    }

    // Array of image objects to return.
    $response = array();

    $absoluteFolderPath = $_SERVER['DOCUMENT_ROOT'] . $folderPath;

    // Image types.
    $image_types = Image::$defaultUploadOptions['validation']['allowedMimeTypes'];

    // Filenames in the uploads folder.
    $fnames = scandir($absoluteFolderPath);

    // Check if folder exists.
    if ($fnames) {
      // Go through all the filenames in the folder.
      foreach ($fnames as $name) {
        // Filename must not be a folder.
        if (!is_dir($name)) {
          // Check if file is an image.

          if (in_array(mime_content_type($absoluteFolderPath . $name), $image_types)) {
            // Build the image.
            $img = new \StdClass;
            $img->url = $folderPath . $name;
            $img->thumb = $thumbPath . $name;
            $img->name = $name;

            // Add to the array of image.
            array_push($response, $img);
          }
        }
      }
    }

    // Folder does not exist, respond with a JSON to throw error.
    else {
      throw new Exception('Images folder does not exist!');
    }

    return $response;
  }
734239
public static List<Document> convert2DocumentList(String folderPath, boolean verbose)
    {
        long start = System.currentTimeMillis();
        List<File> fileList = IOUtil.fileList(folderPath);
        List<Document> documentList = new LinkedList<Document>();
        int i = 0;
        for (File file : fileList)
        {
            if (verbose) System.out.print(file);
            Document document = convert2Document(file);
            documentList.add(document);
            if (verbose) System.out.println(" " + ++i + " / " + fileList.size());
        }
        if (verbose)
        {
            System.out.println(documentList.size());
            System.out.printf("花费时间%d ms\n", System.currentTimeMillis() - start);
        }
        return documentList;
    }
467536
def listdir(self, path):
        
        return [s for s in self.get_all_data().keys()
                if s.startswith(path)]
569369
public List<String> getRoles(String path) {
        List<String> roles = super.getRoles(path);
        roles.add(Role.ASSET_DESIGN);
        return roles;
    }
523065
public List<CmsJspResourceWrapper> readFilesInFolder(String resourcePath) throws CmsException {

        return CmsJspElFunctions.convertResourceList(m_cms, m_cms.getFilesInFolder(resourcePath));
    }
985945
public void getSubFolders(String path, AsyncCallback<List<CmsVfsEntryBean>> callback) {

        m_controller.getSubFolders(path, callback);
    }
1045045
def list(self, device_path, timeout_ms=None):
    """"""
    return self.filesync_service.list(
        device_path, timeouts.PolledTimeout.from_millis(timeout_ms))
219475
public static String[] getColumnFamilyList(String path) throws RocksDBException {
        List<byte[]> cfList = RocksDB.listColumnFamilies(new Options(), path);
        if (cfList == null || cfList.size() == 0) {
            return ArrayUtils.EMPTY_STRING_ARRAY;
        }
        List<String> result = new ArrayList<>(cfList.size());
        for (byte[] cf : cfList) {
            result.add(new String(cf, StandardCharsets.UTF_8));
        }
        return result.toArray(ArrayUtils.EMPTY_STRING_ARRAY);
    }
1266967
public static String read(String filePath) throws IOException, NotFoundException {
        BufferedImage image = ImageIO.read(new File(filePath));
        return read(image);
    }
888675
public void loadFolder(String folderPath) {
		// Get the file path.
		File path = null;
		if(folderPath != null && folderPath.length() > 0) {
			path = new File(folderPath);
		}
		
		this.loadFolder(path);
	}
529497
public static function getImageResolution($filePath, $throwException = false)
    {
        $dimensions = @getimagesize(Yii::getAlias($filePath));
        
        $width = 0;
        $height = 0;
        
        if (isset($dimensions[0]) && isset($dimensions[1])) {
            $width = (int)$dimensions[0];
            $height = (int)$dimensions[1];
        } elseif ($throwException) {
            throw new Exception("Unable to determine the resoltuions of the file $filePath.");
        }
        
        return [
            'width' => $width,
            'height' => $height,
        ];
    }
163094
public function listDirectory($path = '')
    {
        $path = '/home/'.$this->userName.'/'.$path;
        $this->returnCode = 'no';
        $responseVesta = $this->send('v-list-fs-directory', $this->userName, $path);

        return $this->parseListing($responseVesta);
    }
744499
public static function getImageInfo($imagePath)
    {
        if (!is_file($imagePath)) {
            throw new ImageNotFoundException(
                sprintf("File '%s' not found. Are you sure this is the right path?", $imagePath)
            );
        }

        $info = getimagesize($imagePath);

        return [
            'mime' => $info['mime'],
            'width' => $info[0],
            'height' => $info[1],
        ];
    }
800443
public static File[] ls(String path) {
		if (path == null) {
			return null;
		}

		path = getAbsolutePath(path);

		File file = file(path);
		if (file.isDirectory()) {
			return file.listFiles();
		}
		throw new IORuntimeException(StrUtil.format("Path [{}] is not directory!", path));
	}
16783
def list(self, path, filename=None, start=None, stop=None, recursive=False, directories=False):
        
        storageScheme, keys = self.getkeys(
            path, filename=filename, directories=directories, recursive=recursive)
        keys = [storageScheme + ":///" + key.bucket.name + "/" + key.name for key in keys]
        keys.sort()
        keys = select(keys, start, stop)
        return keys
538528
function _getFiles(path){
        let files = [];
        fs.readdirSync(path).forEach(function(file){
            let subpath = path + '/' + file;
            if(fs.lstatSync(subpath).isDirectory()){
                let filesReturned = _getFiles(subpath);
                files = files.concat(filesReturned);
            } else {
                files.push(path + '/' + file);
            }
        });
        return files;
    }
1143384
public static Observable<Bitmap> getVideoThumbnail(final String filePath) {
    return Observable.fromCallable(new Func0<Bitmap>() {
      @Override
      public Bitmap call() {
        return ThumbnailUtils.createVideoThumbnail(filePath,
            MediaStore.Images.Thumbnails.MINI_KIND);
      }
    });
  }