Package com.tumblr.play.interop

Source Code of com.tumblr.play.interop.PrivilegedHelper

package com.tumblr.play.interop;

import java.io.*;
import org.yaml.snakeyaml.Yaml;

public class PrivilegedHelper {
  public static Privileged fromFile(final String filename) throws FileNotFoundException {
    if (filename == null) {
      throw new FileNotFoundException("null obviously could not be found");
    }
    final File file = new File(filename);
    final Yaml yaml = new Yaml(new CustomClassLoaderConstructor(Privileged.class));
    final InputStream fis = new FileInputStream(file);
    Privileged p = null;
    try {
      p = (Privileged) yaml.load(fis);
    } finally {
      try {
        fis.close();
      } catch (Exception e) { }
    }
    return p;
  }
}
TOP

Related Classes of com.tumblr.play.interop.PrivilegedHelper

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.