Переместить java AWT-список внутри jframe [duplicate]

Начиная с марта 2017 года: с добавлением Облачных функций Firebase и более глубокой интеграции Firebase с Google Cloud, теперь это возможно.

С помощью функций Cloud вы можете использовать пакет Google Cloud Node для выполнения операций epic в облачном хранилище. Ниже приведен пример, который получает все URL-адреса файлов в массив из облачного хранилища. Эта функция будет запускаться каждый раз, когда что-то будет сохранено в облачном хранилище Google.

Примечание 1 : Это довольно дорогостоящая операция, так как она должна циклически перемещаться по всем файлам в ведре / папке.

Примечание 2 : Я написал это как пример, не вдаваясь в подробности в обещания и т. д. Просто чтобы дать представление.

const functions = require('firebase-functions');
const gcs = require('@google-cloud/storage')();

// on file upload to google cloud storage
exports.fileUploaded = functions.storage.object().onChange(event => {

  const object = event.data; // the object that was just uploaded
  const bucket = gcs.bucket(object.bucket);
  const signedUrlConfig = { action: 'read', expires: '03-17-2025' }; // this is a signed url configuration object

  var fileURLs = []; // array to hold all file urls 

  // just for example. ideally you should get this from the object that is uploaded for this to be a better function :)
  // so that you can calculate the size of the folder it's uploaded to, and do something with it etc.
  const folderPath = "a/path/you/want/its/folder/size/calculated";

  bucket.getFiles({ prefix: folderPath }, function(err, files) {
    // files = array of file objects
    // not the contents of these files, we're not downloading the files. 

    files.forEach(function(file) {
      file.getSignedUrl(signedUrlConfig, function(err, fileURL) {
        console.log(fileURL);
        fileURLs.push(fileURL);
      });
    });

  });

});

I надеюсь, это даст вам общую идею. Для получения лучших примеров функций облачности, проверьте репозиторий Google Github, полный примеров облачных функций для Firebase . Также проверьте их Документацию API Google Cloud Node

7
задан jjnguy 21 June 2010 в 14:50
поделиться