FileMeta is a class which will hold file meta data. Each LoaderBase contains a FileMeta object
that you can use to query.

@class FileMeta
@constructor
@param {String} header HTTP Header sent when loading this file
970391
function (header) {
  /**
   * This property is the mimetype for the file
   *
   * @property mime
   * @type {String}
   */
  this.mime = null;

  /**
   * This is the file size in bytes
   *
   * @type {Number}
   */
  this.size = null;

  /**
   * This is a Date object which represents the last time this file was modified
   *
   * @type {Date}
   */
  this.lastModified = null;

  /**
   * This is the HTTP header as an Object for the file.
   *
   * @type {Object}
   */
  this.httpHeader = null;

  if (header) this.setFromHTTPHeader(header);
}
699073
static BlockMetadataHeader readHeader(File file) throws IOException {
    DataInputStream in = null;
    try {
      in = new DataInputStream(new BufferedInputStream(
                               new FileInputStream(file)));
      return readHeader(in);
    } finally {
      IOUtils.closeStream(in);
    }
  }
729825
Config readMetadata() throws IOException {
    if (!isStoreMetadataFilePresent()) {
      throw new IOException("Store metadata file does not exist at " + this.storeMetadataFilePath);
    }
    try (InputStream storeMetadataInputStream = this.fs.open(this.storeMetadataFilePath)) {
      return ConfigFactory.parseReader(new InputStreamReader(storeMetadataInputStream, Charsets.UTF_8));
    }
  }
843382
function updateMetadata(metadata, form) {
  metadata.files[form.id] = {
    name: form.name,
    path: path.join(ZIP_SUBFOLDER_NAME, form.id + '.json')
  };
}
136240
function loadMetaSet(root) {
            var paths = innerCore.getMemberPaths(root, CONSTANTS.META_SET_NAME),
                i,
                metaNodes = [];

            return TASYNC.call(function () {
                for (i = 0; i < paths.length; i += 1) {
                    metaNodes.push(innerCore.loadByPath(root, paths[i]));
                }

                return TASYNC.lift(metaNodes);
            }, self.loadPaths(self.getHash(root), JSON.parse(JSON.stringify(paths))));
        }
352145
async function displayStatusInfo(rootFolder, metadata) {
    const local = path.join(rootFolder, constants.META_DIR, constants.META_LOCAL);
    const remote = path.join(rootFolder, constants.META_DIR, constants.META_REMOTE);

    // Get valid extensions for code files
    const extensions = eaft.getCodeExtensions();

    const files = [];
    const keys = [];
    const data = [];
    data.local = JSON.parse(fs.readFileSync(local, 'utf8'));
    data.remote = JSON.parse(fs.readFileSync(remote, 'utf8'));

    // Construct array with filename, extension and environment as key
    for (const env in data) {
        for (const codeFile of data[env].files) {
            const extension = eaft.getExtensionFromFiletype(codeFile.type, extensions);
            const key = `${codeFile.name}${extension}.${env}`;
            keys.push(key);
            codeFile.environment = env;
            files[key] = codeFile;
        }
    }

    // Sort keys
    keys.sort();

    // Track what we need to print
    const addedFiles = [];
    const modifiedFiles = [];
    const deletedFiles = [];

    // Iterate over all keys
    for (let i = 0; i < keys.length; i++) {
        const file = files[keys[i]];
        const extension = eaft.getExtensionFromFiletype(file.type, extensions);
        const nextFile = files[keys[i + 1]];

        if (nextFile && file.name === nextFile.name && file.type === nextFile.type) {
            // We can skip 1 ahead
            i++;
            if (file.source !== nextFile.source) {
                modifiedFiles.push(file.name + extension);
            }
        } else if (file.environment === 'local') {
            addedFiles.push(file.name + extension);
        } else if (file.environment === 'remote') {
            deletedFiles.push(file.name + extension);
        }
    }

    // Display something if everything is ok
    if (addedFiles.length === 0 && modifiedFiles.length === 0 && deletedFiles.length === 0) {
        process.stdout.write(`Your local and remote project for '${metadata.name}' are in sync`);
        checkbox.display(`green`);
    } else {
        process.stdout.write(`There are some differences between your local and remote projectfiles for '${metadata.name}'`);
        console.log(``);

        // Display added files
        if (addedFiles.length > 0) {
            console.log(``);
        }
        for (const added of addedFiles) {
            console.log(`   + ${added}`.green);
        }

        // Display modified files
        if (modifiedFiles.length > 0) {
            console.log(``);
        }
        for (const modified of modifiedFiles) {
            console.log(`   ~ ${modified}`.yellow);
        }

        // Display removed files
        if (deletedFiles.length > 0) {
            console.log(``);
        }
        for (const deleted of deletedFiles) {
            console.log(`   - ${deleted}`.red);
        }
        console.log(``);
    }
}
1226500
public void parseHeaders () throws IOException {
		if(!parsedHeader) {
			arcRecord.skipHttpHeader();
			// copy all HTTP headers to metaData, prefixing with 
			// HTTP_HEADER_PREFIX
			Header[] headers = arcRecord.getHttpHeaders();
			if (headers != null) {
				for (int i = 0; i < headers.length; i++) {
					String value = headers[i].getValue();
					String name = headers[i].getName();
					metaData.put(HTTP_HEADER_PREFIX + name,value);
					if(name.toUpperCase().contains(
							HttpHeaderOperation.HTTP_TRANSFER_ENC_HEADER)) {
						if(value.toUpperCase().contains(
								HttpHeaderOperation.HTTP_CHUNKED_ENCODING_HEADER)) {
							setChunkedEncoding();
						}
					}
				}
			}

			// copy all ARC record header fields to metaData, prefixing with 
			// ARC_META_PREFIX
			Map<String,Object> headerMetaMap = arcRecord.getMetaData().getHeaderFields();
			Set<String> keys = headerMetaMap.keySet();
			Iterator<String> itr = keys.iterator();
			while(itr.hasNext()) {
				String metaKey = itr.next();
				Object value = headerMetaMap.get(metaKey);
				String metaValue = "";
				if(value != null) {
					metaValue = value.toString();
				}
				metaData.put(ARC_META_PREFIX + metaKey,metaValue);
			}
		
			parsedHeader = true;			
		}
	}
294635
function fileReader(moduleMeta) {
  // Read file from disk and return a module meta
  return pstream(readFile(moduleMeta.path))
    .then(function(text) {
      return {
        source: text
      };
    }, log2console);
}
1374568
function(method, url, headers, data, callback) {

		var r = new XMLHttpRequest();
		var error = this.error;

		// Binary?
		var binary = false;
		if (method === 'blob') {
			binary = method;
			method = 'GET';
		}

		method = method.toUpperCase();

		// Xhr.responseType 'json' is not supported in any of the vendors yet.
		r.onload = function(e) {
			var json = r.response;
			try {
				json = JSON.parse(r.responseText);
			}
			catch (_e) {
				if (r.status === 401) {
					json = error('access_denied', r.statusText);
				}
			}

			var headers = headersToJSON(r.getAllResponseHeaders());
			headers.statusCode = r.status;

			callback(json || (method === 'GET' ? error('empty_response', 'Could not get resource') : {}), headers);
		};

		r.onerror = function(e) {
			var json = r.responseText;
			try {
				json = JSON.parse(r.responseText);
			}
			catch (_e) {}

			callback(json || error('access_denied', 'Could not get resource'));
		};

		var x;

		// Should we add the query to the URL?
		if (method === 'GET' || method === 'DELETE') {
			data = null;
		}
		else if (data && typeof (data) !== 'string' && !(data instanceof FormData) && !(data instanceof File) && !(data instanceof Blob)) {
			// Loop through and add formData
			var f = new FormData();
			for (x in data) if (data.hasOwnProperty(x)) {
				if (data[x] instanceof HTMLInputElement) {
					if ('files' in data[x] && data[x].files.length > 0) {
						f.append(x, data[x].files[0]);
					}
				}
				else if (data[x] instanceof Blob) {
					f.append(x, data[x], data.name);
				}
				else {
					f.append(x, data[x]);
				}
			}

			data = f;
		}

		// Open the path, async
		r.open(method, url, true);

		if (binary) {
			if ('responseType' in r) {
				r.responseType = binary;
			}
			else {
				r.overrideMimeType('text/plain; charset=x-user-defined');
			}
		}

		// Set any bespoke headers
		if (headers) {
			for (x in headers) {
				r.setRequestHeader(x, headers[x]);
			}
		}

		r.send(data);

		return r;

		// Headers are returned as a string
		function headersToJSON(s) {
			var r = {};
			var reg = /([a-z\-]+):\s?(.*);?/gi;
			var m;
			while ((m = reg.exec(s))) {
				r[m[1]] = m[2];
			}

			return r;
		}
	}
432189
static void writeHeader(DataOutputStream out, DataChecksum checksum)
                         throws IOException {
    writeHeader(out, new BlockMetadataHeader(METADATA_VERSION, checksum));
  }
843457
protected function getHeadersForHeadRequest(array $fileMeta) : array
    {
        $headers = [
            'Upload-Length' => (int) $fileMeta['size'],
            'Upload-Offset' => (int) $fileMeta['offset'],
            'Cache-Control' => 'no-store',
        ];

        if (self::UPLOAD_TYPE_FINAL === $fileMeta['upload_type'] && $fileMeta['size'] !== $fileMeta['offset']) {
            unset($headers['Upload-Offset']);
        }

        if (self::UPLOAD_TYPE_NORMAL !== $fileMeta['upload_type']) {
            $headers += ['Upload-Concat' => $fileMeta['upload_type']];
        }

        return $headers;
    }
1029725
function buildMetadata(f, metadataTarget, options, isText) {

  var ext = path.extname(f);
  var name = path.basename(f, ext);

  var data = buildMetadataContent(name, options, ext, isText);

  fs.ensureFileSync(metadataTarget);
  fs.writeFileSync(metadataTarget, data, 'utf8');

}
71374
@Override
    public MetaData<?, ?> readMetaData(IoBuffer buffer) {
        MetaData<?, ?> retMeta = new MetaData<String, Object>();
        Input input = new Input(buffer);
        String metaType = Deserializer.deserialize(input, String.class);
        log.debug("Metadata type: {}", metaType);
        Map<String, ?> m = Deserializer.deserialize(input, Map.class);
        retMeta.putAll(m);
        return retMeta;
    }
413410
function(uri, method, headers, data, encType) {
    var config = this.config;
    var flags = [];
    var str;

    method = method || 'GET';

    if (data && method.toLowerCase() === 'get') {
      uri += this.buildQueryString(data);
    }

    str = ['curl', this.buildFlag('X', method.toUpperCase(), 0, ''), '"' + uri + '"'].join(' ');

    if (headers) {
      _.each(headers, function(val, header) {
        flags.push(this.buildFlag('H', header + config.HEADER_SEPARATOR + val, 5));
      }, this);
    }

    if (data && method.toLowerCase() !== 'get') {
      if (encType === undefined || encType.match(this.formatter.jsonMediaType)) {
        flags.push(this.buildFlag('-data', this.formatData(data), 5, '\''));
      } else if (encType === 'multipart/form-data') {
        flags.push(this.buildFlag('-form', this.formatForm(data), 5, '"'));
      } else {
        // The non-JSON, non-multipart data is a raw string.  Do not format it.
        flags.push(this.buildFlag('-data', data));
      }
    }

    if (flags.length) {
      return str + config.NEW_LINE + flags.join(config.NEW_LINE);
    }
    return str;
  }
894355
function(data) {
      var extras = {};

      if (data instanceof File) {
        extras = this.meta(data);
        data = data.toDataURL();
      }
      var parts = data.split(","), headers = parts[0].split(":"), body;

      if (parts.length !== 2 || headers.length !== 2 || headers[0] !== "data") {
        throw new Error("Invalid data URI.");
      }
      headers = headers[1].split(";");
      body = (headers[1] === "base64") ? atob(parts[1]) : decodeURI(parts[1]);
      var length = body.length, buffer = new ArrayBuffer(length), bytes = new Uint8Array(buffer);

      for (var i = 0; i < length; i++) {
        bytes[i] = body.charCodeAt(i);
      }
      return angular.extend(new Blob([bytes], { type: headers[0] }), extras);
    }
489292
protected void populateResponseHeaders(Set<String> requestHeaderKeys, Map<String,String> metaInfo, HttpServletResponse response) {
        for (String key : metaInfo.keySet()) {
            if (!Listener.AUTHENTICATED_USER_HEADER.equals(key)
                    && !Listener.AUTHENTICATED_JWT.equals(key)
                    && !Listener.METAINFO_HTTP_STATUS_CODE.equals(key)
                    && !Listener.METAINFO_ACCEPT.equals(key)
                    && !Listener.METAINFO_CONTENT_TYPE.equals(key)
                    && !Listener.METAINFO_DOWNLOAD_FORMAT.equals(key)
                    && !Listener.METAINFO_MDW_REQUEST_ID.equals(key)
                    && !requestHeaderKeys.contains(key))
                response.setHeader(key, metaInfo.get(key));
        }

        // these always get populated if present
        if (metaInfo.get(Listener.METAINFO_REQUEST_ID) != null)
            response.setHeader(Listener.METAINFO_REQUEST_ID, metaInfo.get(Listener.METAINFO_REQUEST_ID));
        if (metaInfo.get(Listener.METAINFO_MDW_REQUEST_ID) != null && !metaInfo.get(Listener.METAINFO_MDW_REQUEST_ID).equals("0"))
            response.setHeader(Listener.METAINFO_MDW_REQUEST_ID, metaInfo.get(Listener.METAINFO_MDW_REQUEST_ID));
        if (metaInfo.get(Listener.METAINFO_CORRELATION_ID) != null)
            response.setHeader(Listener.METAINFO_CORRELATION_ID, metaInfo.get(Listener.METAINFO_CORRELATION_ID));
        if (metaInfo.get(Listener.METAINFO_DOCUMENT_ID) != null)
            response.setHeader(Listener.METAINFO_DOCUMENT_ID, metaInfo.get(Listener.METAINFO_DOCUMENT_ID));
    }
39443
def metadata(self, filename):
        '''
        
        '''
        meta = self.get_metadata(filename)
        # Fix backend mime misdetection
        meta['mime'] = meta.get('mime') or files.mime(filename, self.DEFAULT_MIME)
        return meta