/*
(non-Javadoc)

@see example.webapp.dao.interfaces.Dao#load(java.io.Serializable)
16174
public Event load(Serializable id) {
		String sql = "select * from Event where id = ?";
		return getSimpleJdbcTemplate().queryForObject(sql, new EventMapper(), id);
	}
650522
@Override
	protected void loadProperties(final Properties props) throws IOException {
		if (locations != null) {
			for (int i = 0; i < locations.length; i++) {
				final Resource location = locations[i];
				if (logger.isInfoEnabled()) {
					logger.info("Loading properties file from " + location);
				}
				File file = null;
				InputStream is = null;
				try {
					try {
						file = location.getFile();
						is = new BufferedInputStream(new FileInputStream(file));
					} catch (final IOException ie) {// ignore
					} finally {
						if (file == null) {
							is = location.getInputStream();
						}
					}

					if (location.getFilename().toLowerCase().endsWith(Constants.XML_FILE_EXTENSION)) {
						persister.loadFromXml(props, is);
					} else if (location.getFilename().toLowerCase().endsWith(Constants.JSON_FILE_EXTENSION)) {
						if (fileEncoding != null) {
							persister.loadFromJson(props, new InputStreamReader(is, Charset.forName(fileEncoding)));
						} else {
							persister.loadFromJson(props, is);
						}
					} else if (location.getFilename().toLowerCase().endsWith(Constants.YAML_FILE_EXTENSION)) {
						if (fileEncoding != null) {
							persister.loadFromYAML(props, new InputStreamReader(is, Charset.forName(fileEncoding)));
						} else {
							persister.loadFromYAML(props, is);
						}
					} else {
						if (fileEncoding != null) {
							persister.load(props, new InputStreamReader(is, Charset.forName(fileEncoding)));
						} else {
							persister.load(props, is);
						}
					}
				} catch (final IOException ex) {
					if (ignoreResourceNotFound) {
						if (logger.isWarnEnabled()) {
							logger.warn("Could not load properties from " + location + ": " + ex.getMessage());
						}
					} else {
						throw ex;
					}
				} finally {
					if (is != null) {
						is.close();
					}
				}
			}
		}
	}
172726
public void load(String name) throws IOException
    {
        if (hasLocalVariable(name))
        {
            tload(name);
        }
        else
        {
            aload(0);
            getField(name);
        }
    }
255368
@Override
    public List<HBaseData> LoadData(HTableInterface hTable, String columnFamily, Object rowKey, Filter filter,
            String... columns) throws IOException
    {
        List<HBaseData> results = new ArrayList<HBaseData>();
        if (scanner == null)
        {

            // only in case of find by id
            Scan scan = null;
            if (rowKey != null)
            {
                byte[] rowKeyBytes = HBaseUtils.getBytes(rowKey);
                Get g = new Get(rowKeyBytes);

                // TODO: After more than one column family for 1 table. this
                // should work. currently failing for embeddable entities.
                if (columnFamily != null)
                {
                    g.addFamily(Bytes.toBytes(columnFamily));
                }

                if (filter != null)
                {
                    g.setFilter(filter);
                }
                Result result = hTable.get(g);

                if (result != null && result.list() != null)
                {
                    HBaseData data = null;
                    for (KeyValue value : result.list())
                    {
                        data = new HBaseData(columnFamily != null ? columnFamily : new String(value.getFamily()),
                                value.getRow());
                        break;
                    }

                    if (data != null)
                    {
                        data.setColumns(result.list());
                        results.add(data);
                    }

                }
                return results;

                // scan = new Scan(g);
            }
            else
            {
                scan = new Scan();
            }
            setScanCriteria(filter, columnFamily, null, scan, columns);
            scanner = hTable.getScanner(scan);
            resultsIter = scanner.iterator();
        }
        return scanResults(columnFamily, results);
    }
287661
@Override
    public void load(Callback<Void> callback, Class[] loadClasses) {
        boolean doNotLoad = false;
        for (Class clazzes : loadClasses) {
            try {
                Class.forName(clazzes.getName());
            } catch (ClassNotFoundException e) {
                callback.onFailure(e);
                doNotLoad = true;
            }
        }
        if (!doNotLoad) {
            doLoad(callback);
        }
    }
629108
private synchronized void load() {
    Map<String, HadoopServer> map = new TreeMap<String, HadoopServer>();
    for (File file : saveDir.listFiles()) {
      try {
        HadoopServer server = new HadoopServer(file);
        map.put(server.getLocationName(), server);

      } catch (Exception exn) {
        System.err.println(exn);
      }
    }
    this.servers = map;
  }
274261
public void load(HttpEntity entity, int maxBytes) throws IOException {

        contentType = null;
        Header type = entity.getContentType();
        if (type != null) {
            contentType = type.getValue();
        }

        contentEncoding = null;
        Header encoding = entity.getContentEncoding();
        if (encoding != null) {
            contentEncoding = encoding.getValue();
        }

        Charset charset;
        try {
            charset = ContentType.getOrDefault(entity).getCharset();
        } catch (Exception e) {
            logger.warn("parse charset failed: {}", e.getMessage());
            charset = Charset.forName("UTF-8");
        }

        if (charset != null) {
            contentCharset = charset.displayName();
        }

        contentData = toByteArray(entity, maxBytes);
    }
35141
public void loadFromJSON(final InputStream is) throws IOException {
		lock.writeLock().lock();
		try {
			final JsonFactory f = new JsonFactory();
			final JsonParser jp = f.createParser(is);
			configureJsonParser(jp);
			if (jp.nextToken() == JsonToken.START_OBJECT) {
				traverseJSON(jp, null);
			}
		} finally {
			lock.writeLock().unlock();
		}
	}
962500
private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
        GetField fields = in.readFields();
        classLoaderIdentifier = (String) fields.get(CLASS_LOADER_IDENTIFIER, null);

        // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadContext
        // in order to re-establish the thread context based on the metadata identifier if not defaulted.
    }
1050072
public void load() {
        try {
            setPersistFile();
            XMLObjectReader reader = XMLObjectReader.newInstance(new FileInputStream(persistFile.toString()));
            reader.setBinding(binding);
            load(reader);
        } catch (XMLStreamException | FileNotFoundException e) {
            System.err.println(String.format("Error while load the MAP Resource state from file=%s", persistFile.toString()));
            e.printStackTrace();
        }
    }
25324
void loadClient(String persistenceUnit, Client client)
    {
        if (!clientMap.containsKey(persistenceUnit) && client != null)
        {
            clientMap.put(persistenceUnit, client);
        }
    }
1147911
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
        in.defaultReadObject();
        this.factoryLoader = ServiceLoader.load(PropertyFactory.class, PropertyFactory.class.getClassLoader());
    }
223598
public <T extends RoxPayload> T load(String name, Class<T> clazz) throws IOException {
		InputStreamReader isr = new InputStreamReader(
			new FileInputStream(new File(getTmpDir(clazz), name)),
			Charset.forName(Constants.ENCODING).newDecoder()
		);
		
		return serializer.deserializePayload(isr, clazz);
	}
1276118
public static <T> T loadJsonToBean(String jsonPath, String encoding, Class<T> clazz) throws IOException {
        JSONObject jsonObject = JSONObject.parseObject(FileExecutor.readFileToString(new File(jsonPath), encoding));
        return JSONObject.toJavaObject(jsonObject, clazz);
    }
637162
@Override
	public String load(String resource, String[] paths, String charset) throws IOException {
		for (ResourceLoader loader : loaders) {
			if (loader.exists(resource, paths)) {
				return loader.load(resource, paths, charset);
			}
		}
		throw new IOException("No such file " + resource);
	}
1042504
public OStorageConfiguration load() throws OSerializationException {
    final byte[] record = storage.readRecord(CONFIG_RID, null, false, null).buffer;

    if (record == null)
      throw new OStorageException("Cannot load database's configuration. The database seems to be corrupted.");

    fromStream(record);
    return this;
  }
752158
private static Map<Class<?>, SerDeserializer> loadFromClasspath() {
        // log errors to System.err, as problems in static initializers can be troublesome to diagnose
        Map<Class<?>, SerDeserializer> result = new HashMap<>();
        URL url = null;
        try {
            // this is the new location of the file, working on Java 8, Java 9 class path and Java 9 module path
            ClassLoader loader = Thread.currentThread().getContextClassLoader();
            if (loader == null) {
                loader = RenameHandler.class.getClassLoader();
            }
            Enumeration<URL> en = loader.getResources("META-INF/org/joda/beans/JodaBeans.ini");
            while (en.hasMoreElements()) {
                url = en.nextElement();
                List<String> lines = loadRenameFile(url);
                parseRenameFile(lines, url, result);
            }
        } catch (Error | Exception ex) {
            System.err.println("ERROR: Unable to load JodaBeans.ini: " + url + ": " + ex.getMessage());
            ex.printStackTrace();
            result.clear();
        }
        return result;
    }