/*
@see com.ibm.ws.sib.admin.JsMessagingEngine#getFilestore()
518109
public final LWMConfig getFilestore() {

        String thisMethodName = "getFilestore";

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(tc, thisMethodName, this);
            SibTr.exit(tc, thisMethodName, _fs);
        }

        return _fs;
    }
630162
public static function getStores()
	{
		// Get a list of types, only including php files
		$glob = glob(__DIR__ . DIRECTORY_SEPARATOR . 'Storage' . DIRECTORY_SEPARATOR . '*.php');

		$names = array();

		if ($glob === false)
		{
			return $names;
		}

		// Loop through the types and find the ones that are available
		foreach ($glob as $handler)
		{
			// Get just the file name
			$name = basename($handler);

			// Derive the class name from the type
			$class = __NAMESPACE__ . '\\Storage\\' . str_ireplace('.php', '', ucfirst(trim($name)));

			// If the class doesn't exist, these are not the droids you're looking for...
			if (!class_exists($class))
			{
				continue;
			}

			// Our class exists, so now we just need to know if it passes it's test method
			if (call_user_func_array(array($class, 'isAvailable'), array()))
			{
				$names[] = str_ireplace('.php', '', $name);
			}
		}

		$names = array_map('strtolower', $names);

		return $names;
	}
1181556
public String getKeyStore()
			throws IOException
	{
		if (!isSecured())
		{
			return null;
		}
		
		if (keyStore == null)
		{
			throw new IllegalArgumentException("You must specify keystore file location");
		}

		final File keyStoreFile = new File(keyStore);

		if (!keyStoreFile.exists())
		{
			throw new FileNotFoundException(String.format("KeyStore file '%s' does not exists",
														  keyStoreFile.getAbsolutePath()));
		}

		return keyStore;
	}
898777
public static void setDefaultStorageFileProvider ()
  {
    setStorageFileProvider (aMetadata -> {
      final LocalDateTime aNow = PDTFactory.getCurrentLocalDateTime ();
      final String sFilename = StringHelper.getConcatenatedOnDemand (PDTIOHelper.getLocalDateTimeForFilename (aNow),
                                                                     "-",
                                                                     aMetadata.getErrorID ()) +
                               ".xml";
      return WebFileIO.getDataIO ()
                      .getFile ("internal-errors/" +
                                aNow.getYear () +
                                "/" +
                                StringHelper.getLeadingZero (aNow.getMonthValue (), 2) +
                                "/" +
                                sFilename);
    });
  }
378554
public synchronized AuthStorage getStorage(){
        if(storage==null){
            String cls = Objects.get(config,"storageClass",LogStorage.class.getName());
            try{
                storage = (AuthStorage)Class.forName(cls).newInstance();
            }catch (Exception e){
                throw S1SystemError.wrap(e);
            }
        }
        return storage;
    }
1264719
public static Map<String, StoreDefinition> getSystemStoreDefMap() {
        Map<String, StoreDefinition> sysStoreDefMap = Maps.newHashMap();
        List<StoreDefinition> storesDefs = SystemStoreConstants.getAllSystemStoreDefs();
        for(StoreDefinition def: storesDefs) {
            sysStoreDefMap.put(def.getName(), def);
        }
        return sysStoreDefMap;
    }
185217
public File getFile() throws IOException {
        URL url = getURL();
        return GrailsResourceUtils.getFile(url, getDescription());
    }
200026
public I_CmsSessionStorageProvider getSessionStorageProvider() {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_sessionStorageProvider)) {
            return new CmsDefaultSessionStorageProvider();
        }
        try {
            I_CmsSessionStorageProvider sessionCacheProvider = (I_CmsSessionStorageProvider)Class.forName(
                m_sessionStorageProvider).newInstance();
            if (CmsLog.INIT.isInfoEnabled()) {
                CmsLog.INIT.info(
                    Messages.get().getBundle().key(
                        Messages.INIT_SESSION_STORAGEPROVIDER_SUCCESS_1,
                        m_sessionStorageProvider));
            }
            return sessionCacheProvider;
        } catch (Throwable t) {
            LOG.error(
                Messages.get().getBundle().key(
                    Messages.LOG_INIT_SESSION_STORAGEPROVIDER_FAILURE_1,
                    m_sessionStorageProvider),
                t);
            return new CmsDefaultSessionStorageProvider();
        }
    }
166976
private IPersistenceStore getStore(IScope scope, boolean persistent) {
        IPersistenceStore store;
        if (!persistent) {
            // Use special store for non-persistent shared objects
            if (!scope.hasAttribute(SO_TRANSIENT_STORE)) {
                store = new RamPersistence(scope);
                scope.setAttribute(SO_TRANSIENT_STORE, store);
                return store;
            }
            return (IPersistenceStore) scope.getAttribute(SO_TRANSIENT_STORE);
        }
        // Evaluate configuration for persistent shared objects
        if (!scope.hasAttribute(SO_PERSISTENCE_STORE)) {
            try {
                store = PersistenceUtils.getPersistenceStore(scope, persistenceClassName);
                log.info("Created persistence store {} for shared objects", store);
            } catch (Exception err) {
                log.warn("Could not create persistence store ({}) for shared objects, falling back to Ram persistence", persistenceClassName, err);
                store = new RamPersistence(scope);
            }
            scope.setAttribute(SO_PERSISTENCE_STORE, store);
            return store;
        }
        return (IPersistenceStore) scope.getAttribute(SO_PERSISTENCE_STORE);
    }
206910
public static TrustManagerFactory getTrustManagerFactory(String trustStoreFilename, StoreProperties storeProperties)
      throws IOException, GeneralSecurityException {
    InputStream is = getResourceAsStream(trustStoreFilename);
    if (is == null) {
      throw new FileNotFoundException("Certificate file not found: " + getFilenameInfo(trustStoreFilename));
    }
    try {
      return getTrustManagerFactory(is, storeProperties);
    }
    finally {
      try {
        is.close();
      }
      catch (IOException ex) {
        // ignore
      }
    }
  }
1348257
public File getFile()
   {
      File file = (File)this.getSource();
      
      if(file != null)
          FileMonitor.waitFor(file);
      
      return file;
  
   }
770047
public void loadStoreFile() {
    try {
      BufferedInputStream bis = new BufferedInputStream(
          new FileInputStream(this.storeFile)
      );
      JSONTokener jsonTokener = new JSONTokener(new InputStreamReader(bis));
      JSONArray array = new JSONArray(jsonTokener);

      bis.close();

      // Init our keys array with the correct size.
      this.keys = new ConcurrentHashMap<String, Key>(array.length());

      for (int i = 0, j = array.length(); i < j; i += 1) {
        JSONObject obj = array.getJSONObject(i);
        Key key = new Key(obj.getString("name"), obj.getString("data"));
        log.debug("Adding {} key to keystore.", key.name());
        this.addKey(key);
      }
    } catch (FileNotFoundException e) {
      log.error("Could not find JSONKeystore file!");
      log.debug(e.toString());
    } catch (JSONException e) {
      log.error("Error parsing JSON!");
      log.debug(e.toString());
    } catch (IOException e) {
      log.error("Could not close JSONKeystore file!");
      log.debug(e.toString());
    }
  }
1076250
public static File getStorage() {
        //Map<String, File> allStorageLocations = getAllStorageLocations();
        //if (allStorageLocations.isEmpty()){
        //use the current app's storage
        //  return Environment.getDataDirectory();
        //}

        StorageInfo ptr = null;
        List<StorageInfo> storageList = getStorageList();
        for (int i = 0; i < storageList.size(); i++) {
            StorageInfo storageInfo = storageList.get(i);
            if (!storageInfo.readonly && isWritable(new File(storageInfo.path))) {
                if (ptr != null) {
                    //compare free space
                    if (ptr.freeSpace < storageInfo.freeSpace) {
                        ptr = storageInfo;
                    }
                } else {
                    ptr = storageInfo;
                }
            }
        }
        if (ptr != null) {
            return new File(ptr.path);
        }
        //http://stackoverflow.com/questions/21230629/getfilesdir-vs-environment-getdatadirectory
        try {
            return Environment.getExternalStorageDirectory();
        } catch (Exception ex) {
            //trap for android studio layout editor and some for certain devices
            //see https://github.com/osmdroid/osmdroid/issues/508
            return null;
        }
    }
926967
public DataStore getOrAddDataStore(final Collection<String> columns) {
        DataStore ret = getDataStore(columns);
        if (ret == null) {
            ret = this.createDataStore(columns);
        }
        return ret;
    }
699938
@Override
    protected StoreAccessorFactory configureFlashStoreAccessorFactory() {
        final StoreAccessorFactory candidate = configuredMessagesStoreAccessorFactory();
        return candidate == null ? super.configureFlashStoreAccessorFactory() : candidate;
    }
982892
@GET
    public Response getStores() {
        String msg = "getting stores.";
        try {
            return doGetStores(msg);

        } catch (StorageException se) {
            return responseBad(msg, se);

        } catch (Exception e) {
            return responseBad(msg, e);
        }
    }
624786
public JavacFiler getJavacFiler(Object filer) {
		if (filer instanceof JavacFiler) return (JavacFiler) filer;
		
		// try to find a "delegate" field in the object, and use this to check for a JavacFiler
		for (Class<?> filerClass = filer.getClass(); filerClass != null; filerClass = filerClass.getSuperclass()) {
			try {
				return getJavacFiler(tryGetDelegateField(filerClass, filer));
			} catch (final Exception e) {
				// delegate field was not found, try on superclass
			}
		}
		
		processingEnv.getMessager().printMessage(Kind.WARNING,
			"Can't get a JavacFiler from " + filer.getClass().getName() + ". Lombok won't work.");
		return null;
	}