Lookup this record for this session.
@param strFileName The file name.
@return The main record (or null if none).
329740
public Record getRecord(String strFileName)
    {
        Record record = super.getRecord(strFileName);
        if (record == null) if (m_sessionObjectParent != null)
            record = ((BaseSession)m_sessionObjectParent).getRecord(strFileName);   // Look thru the parent window now
        return record;  // Look thru the parent window now
    }
949527
public static AbstractFile getFirstRootFileByName(final SecurityContext securityContext, final String name) {

		logger.debug("Search for file with name: {}", name);

		try {
			final List<AbstractFile> files = StructrApp.getInstance(securityContext).nodeQuery(AbstractFile.class).andName(name).getAsList();

			for (final AbstractFile file : files) {

				if (file.getParent() == null) {
					return file;
				}

			}

		} catch (FrameworkException fex) {

			logger.warn("Unable to find a file for name {}: {}", name, fex.getMessage());
		}

		return null;
	}
658316
public BaseField getField(String strTableName, int iFieldSeq)   // Lookup this field
    {
        if (this.getRecord(strTableName) != this)
            return null;
        return this.getField(iFieldSeq);
    }
1288565
public final String loadString(final String pFileName)
        throws IOException {
    URL urlFile = SrvLedger.class
      .getResource(pFileName);
    if (urlFile != null) {
      InputStream inputStream = null;
      try {
        inputStream = SrvLedger.class.getResourceAsStream(pFileName);
        byte[] bArray = new byte[inputStream.available()];
        inputStream.read(bArray, 0, inputStream.available());
        return new String(bArray, "UTF-8");
      } finally {
        if (inputStream != null) {
          inputStream.close();
        }
      }
    }
    return null;
  }
25826
public DataSet getDataSet(String fileName) {
        if (dataSetCache.containsKey(fileName)) {
            return dataSetCache.get(fileName);
        }
        DataSet dataSet;
        try {
            dataSet = loadDataSetAsStream(fileName);
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
        dataSetCache.put(fileName, dataSet);
        return dataSet;
    }
407975
public InputStream getInputStream(String strFilename)
    {
        InputStream inStream = Utility.getInputStream(strFilename, this.getApplication());
        if (inStream == null)
        	if (this.getParentSession() != null)
        { 
        	Task task = this.getParentSession().getTask();
        	if ((task != null) && (task != this))
        		inStream = task.getInputStream(strFilename);
        }
        return inStream;
    }
1042803
public BaseField getField(String strFieldName)    // Lookup this field
    {
        for (int i = 0; i < this.getRecordlistCount(); i++)
        {
            Record record = this.getRecordlistAt(i);
            BaseField field = record.getField(strFieldName);
            if (field != null)
                return field;
        }
        return null;    // Not found
    }
587086
public Record getMainRecord()
    {
        Record record = super.getMainRecord();
        if (record == null) if (m_sessionObjectParent != null)
            record = ((BaseSession)m_sessionObjectParent).getMainRecord();    // Look thru the parent window now
        return record;
    }
813358
public String getTitle()    // Standard file maint for this record (returns new record)
    {
        String windowName = "Maintenance"; // Default
        Record query = this.getMainRecord();
        if (query != null)
            windowName = query.getRecordName() + ' ' + windowName;  // xxx Maintenance.
        return windowName;
    }
763545
public static String getSqlFile(String fileName) {
		String file = "/jk/sql/".concat(fileName);
		logger.debug("Loading sql file: ", file);
		return readFile(file);
	}
142933
public Record getRecordAt(int i) 
    {
        i -= DBConstants.MAIN_FIELD;    // Zero based index
        try   {
            return (Record)this.elementAt(i);
        } catch (ArrayIndexOutOfBoundsException e)  {
        }
        return null;    // Not found
    }
35779
public static File getIndexFile(String filename) {
        String tmpDir = System.getProperty("java.io.tmpdir");
        File f = new File(filename);
        File indexFile = new File(tmpDir, f.getName() + "_cdk.index");
        f = null;
        return indexFile;
    }
534228
@Override
	public String name() {

		if (file == null) {
			return null;
		}

		String name = null;

		try (Tx tx = StructrApp.getInstance(securityContext).tx()) {

			name = file.getName();
			tx.success();

		} catch (FrameworkException fex) {
			logger.error("", fex);
		}

		return name;
	}
1067502
public Record getMainRecord()
    {
        Record record = super.getMainRecord();
        if (record == null)
            record = new Script(this);
        return record;
    }
576087
private String getCurrentSSpaceFileName() {
        // REMINDER: This instruction is expected to be rare, so rather than
        // save the name and require a lookup every time the current sspace
        // is needed, we use an O(n) call to find the name as necessary
        for (Map.Entry<String,SemanticSpace> e : fileNameToSSpace.entrySet()) {
            if (e.getValue() == current) {
                return e.getKey();
            }
        }
        return null;
    }
479610
public static String getLocalFileName(String recordName){

		if ( protectedIDs.contains(recordName)){
			recordName = "_" + recordName;
		}

		File f = new File(getPath(), CHEM_COMP_CACHE_DIRECTORY);
		if (! f.exists()){
			logger.info("Creating directory " + f);

			boolean success = f.mkdir();
			// we've checked in initPath that path is writable, so there's no need to check if it succeeds
			// in the unlikely case that in the meantime it isn't writable at least we log an error
			if (!success)
				logger.error("Directory {} could not be created",f);

		}

		File theFile = new File(f,recordName + ".cif.gz");

		return theFile.toString();
	}
935465
def _get_record(self, name):
        """"""
        request = self._session.get(self._baseurl, params={'name': name,
                                                           'type': 'A'})
        if not request.ok:
            raise RuntimeError('Failed to search record: %s - %s' %
                               (self._format_hostname(name), request.json()))
        records = request.json()
        if len(records) == 0:
            return
        record = records[0]
        if 'record' not in record or 'id' not in record['record']:
            raise RuntimeError('Invalid record JSON format: %s - %s' %
                               (self._format_hostname(name), request.json()))
        return int(record['record']['id'])