Reads the android target based on project.properties file.

    Returns
      A string containing the project target (android-23 being the default if none is found)
769921
def get_target(self):
    
    with open('%s/project.properties' % self.path) as f:
      for line in f.readlines():
        matches = re.findall(r'^target=(.*)', line)
        if len(matches) == 0:
          continue
        return matches[0].replace('\n', '')
    return 'android-%s' % (config.sdk_version)
240143
private void readProjectProperties(Gantt gantt)
   {
      Gantt.File file = gantt.getFile();
      ProjectProperties props = m_projectFile.getProjectProperties();
      props.setLastSaved(file.getSaved());
      props.setCreationDate(file.getCreated());
      props.setName(file.getName());
   }
1154704
private void processProjectProperties(APIBusinessObjects apibo, ProjectType project)
   {
      ProjectProperties properties = m_projectFile.getProjectProperties();

      properties.setCreationDate(project.getCreateDate());
      properties.setFinishDate(project.getFinishDate());
      properties.setName(project.getName());
      properties.setStartDate(project.getPlannedStartDate());
      properties.setStatusDate(project.getDataDate());
      properties.setProjectTitle(project.getId());
      properties.setUniqueID(project.getObjectId() == null ? null : project.getObjectId().toString());

      List<GlobalPreferencesType> list = apibo.getGlobalPreferences();
      if (!list.isEmpty())
      {
         GlobalPreferencesType prefs = list.get(0);

         properties.setCreationDate(prefs.getCreateDate());
         properties.setLastSaved(prefs.getLastUpdateDate());
         properties.setMinutesPerDay(Integer.valueOf((int) (NumberHelper.getDouble(prefs.getHoursPerDay()) * 60)));
         properties.setMinutesPerWeek(Integer.valueOf((int) (NumberHelper.getDouble(prefs.getHoursPerWeek()) * 60)));
         properties.setWeekStartDay(Day.getInstance(NumberHelper.getInt(prefs.getStartDayOfWeek())));

         List<CurrencyType> currencyList = apibo.getCurrency();
         for (CurrencyType currency : currencyList)
         {
            if (currency.getObjectId().equals(prefs.getBaseCurrencyObjectId()))
            {
               properties.setCurrencySymbol(currency.getSymbol());
               break;
            }
         }
      }
   }
377729
static File getSourceFolder(MavenProject project)
  {
    final Properties projectProperties = project.getProperties();

    if (projectProperties.containsKey(XCodeDefaultConfigurationMojo.XCODE_SOURCE_DIRECTORY)) {
      return new File(project.getBasedir(),
            projectProperties.getProperty(XCodeDefaultConfigurationMojo.XCODE_SOURCE_DIRECTORY));
    }
    return new File(project.getBasedir(), XCodeDefaultConfigurationMojo.DEFAULT_XCODE_SOURCE_DIRECTORY);

  }
787540
private Properties getStatusProperties() {
		final File statusFile = getStatusFile();
		if (statusFile != null) {
			try {
				Properties statusFileProps = new Properties();
				final FileReader statusReader = new FileReader(statusFile);
				try {
					statusFileProps.load(statusReader);
					return statusFileProps;
				} finally {
					statusReader.close();
				}
			} catch (IOException e) {
				getLog().warn("Reading status file failed: " + e.getMessage());
			}
		}
		return null;
	}
185981
def findTargets(self):
        '''
        
        '''

        if DEBUG:
            print >> sys.stderr, "findTargets()"
        LISTVIEW_CLASS = 'android.widget.ListView'
        ''' The ListView class name '''
        self.targets = []
        ''' The list of target coordinates (x1, y1, x2, y2) '''
        self.targetViews = []
        ''' The list of target Views '''
        if CHECK_KEYBOARD_SHOWN:
            if self.device.isKeyboardShown():
                print >> sys.stderr, "#### keyboard is show but handling it is not implemented yet ####"
                # FIXME: still no windows in uiautomator
                window = -1
            else:
                window = -1
        else:
            window = -1
        if self.vc:
            dump = self.vc.dump(window=window, sleep=0.1)
            self.printOperation(None, Operation.DUMP, window, dump)
        else:
            dump = []
        self.dump = dump
        # the root element cannot be deleted from Treeview once added.
        # We have no option but to recreate it
        self.viewTree = ViewTree(self.sideFrame)
        for v in dump:
            if DEBUG:
                print >> sys.stderr, "    findTargets: analyzing", v.getClass(), v.getId()
            if v.getClass() == LISTVIEW_CLASS:
                # We may want to touch ListView elements, not just the ListView
                continue
            parent = v.getParent()
            if (parent and parent.getClass() == LISTVIEW_CLASS and self.isClickableCheckableOrFocusable(parent)) \
                    or self.isClickableCheckableOrFocusable(v):
                # If this is a touchable ListView, let's add its children instead
                # or add it if it's touchable, focusable, whatever
                ((x1, y1), (x2, y2)) = v.getCoords()
                if DEBUG:
                    print >> sys.stderr, "appending target", ((x1, y1, x2, y2))
                v.setTarget(True)
                self.targets.append((x1, y1, x2, y2))
                self.targetViews.append(v)
                target = True
            else:
                target = False

        if self.vc:
            self.vc.traverse(transform=self.populateViewTree)
673699
def resolve_reference(target_reference, project):
    
    # Separate target name from properties override
    assert isinstance(target_reference, basestring)
    assert isinstance(project, ProjectTarget)
    split = _re_separate_target_from_properties.match (target_reference)
    if not split:
        raise BaseException ("Invalid reference: '%s'" % target_reference)

    id = split.group (1)

    sproperties = []

    if split.group (3):
        sproperties = property.create_from_strings(feature.split(split.group(3)))
        sproperties = feature.expand_composites(sproperties)

    # Find the target
    target = project.find (id)

    return (target, property_set.create(sproperties))
899445
def read(self):
        """"""
        assert self.path == self.target.cur_dir
        try:
            self.modified_list = False
            self.modified_sync = False
            is_valid_file = False

            s = self.target.read_text(self.filename)
            # print("s", s)
            if self.target.synchronizer:
                self.target.synchronizer._inc_stat("meta_bytes_read", len(s))
            self.was_read = True  # True if a file exists (even invalid)
            self.dir = json.loads(s)
            # import pprint
            # print("dir")
            # print(pprint.pformat(self.dir))
            self.dir = make_native_dict_keys(self.dir)
            # print(pprint.pformat(self.dir))
            self.list = self.dir["mtimes"]
            self.peer_sync = self.dir["peer_sync"]
            is_valid_file = True
            # write"DirMetadata: read(%s)" % (self.filename, ), self.dir)
        # except IncompatibleMetadataVersion:
        #     raise  # We want version errors to terminate the app
        except Exception as e:
            write_error("Could not read meta info {}: {!r}".format(self, e))

        # If the version is incompatible, we stop, unless:
        # if --migrate is set, we simply ignore this file (and probably replace it
        # with a current version)
        if is_valid_file and self.dir.get("_file_version", 0) != self.VERSION:
            if not self.target or not self.target.get_option("migrate"):
                raise IncompatibleMetadataVersion(
                    "Invalid meta data version: {} (expected {}).\n"
                    "Consider passing --migrate to discard old data.".format(
                        self.dir.get("_file_version"), self.VERSION
                    )
                )
            #
            write(
                "Migrating meta data version from {} to {} (discarding old): {}".format(
                    self.dir.get("_file_version"), self.VERSION, self.filename
                )
            )
            self.list = {}
            self.peer_sync = {}

        return
220196
public void loadPropertyFile(String file, Properties target)
  {
    try
    {
      // Use SecuritySupport class to provide priveleged access to property file
      SecuritySupport ss = SecuritySupport.getInstance();

      InputStream is = ss.getResourceAsStream(ObjectFactory.findClassLoader(),
                                              file);

      // get a buffered version
      BufferedInputStream bis = new BufferedInputStream(is);

      target.load(bis);  // and load up the property bag from this
      bis.close();  // close out after reading
    }
    catch (Exception ex)
    {
      // ex.printStackTrace();
      throw new org.apache.xml.utils.WrappedRuntimeException(ex);
    }
  }
836595
def read(self):
        """"""

        # -- If no project finel found, just return
        if not isfile(PROJECT_FILENAME):
            print('Info: No {} file'.format(PROJECT_FILENAME))
            return

        # -- Read stored board
        board = self._read_board()

        # -- Update board
        self.board = board
        if not board:
            print('Error: invalid {} project file'.format(
                PROJECT_FILENAME))
            print('No \'board\' field defined in project file')
            sys.exit(1)
1026809
private void readProjectProperties(Settings phoenixSettings, Storepoint storepoint)
   {
      ProjectProperties mpxjProperties = m_projectFile.getProjectProperties();
      mpxjProperties.setName(phoenixSettings.getTitle());
      mpxjProperties.setDefaultDurationUnits(phoenixSettings.getBaseunit());
      mpxjProperties.setStatusDate(storepoint.getDataDate());
   }
426389
public Properties readProperties() throws IOException {
        Properties p;

        try (Reader src = newReader()) {
            p = new Properties();
            p.load(src);
        }
        return p;
    }
558331
public T get(GVRAndroidResource androidResource) {
        WeakReference<T> reference = cache.get(androidResource);
        if (reference == null) {
            // Not in map
            // Log.d(TAG, "get(%s) returning %s", androidResource, null);
            return null;
        }
        T cached = reference.get();
        if (cached == null) {
            // In map, but not in memory
            cache.remove(androidResource);
        } else {
            // No one will ever read this stream
            androidResource.closeStream();
        }
        // Log.d(TAG, "get(%s) returning %s", androidResource, cached);
        return cached;
    }
444400
static Method getGetter(Class<?> targetClass, String propertyName) {
		if (targetClass == null) {
			return null;
		}
		final String getterName = getterName(propertyName, false);
		Method result = findPublicGetter(targetClass, getterName, propertyName, false);
		if (result == null) {
			final String booleanGetterName = getterName(propertyName, true);
			result = findPublicGetter(targetClass, booleanGetterName, propertyName, true);
			if (result == null) {
				do {
					result = findNonPublicGetter(targetClass, getterName, propertyName, false);
					if (result == null) {
						result = findNonPublicGetter(targetClass, booleanGetterName, propertyName, true);
					}
				} while (result == null && (targetClass = targetClass.getSuperclass()) != null);
			}
		}

		return result;
	}
743665
private void readProjectProperties(Project ganttProject)
   {
      ProjectProperties mpxjProperties = m_projectFile.getProjectProperties();
      mpxjProperties.setName(ganttProject.getName());
      mpxjProperties.setCompany(ganttProject.getCompany());
      mpxjProperties.setDefaultDurationUnits(TimeUnit.DAYS);

      String locale = ganttProject.getLocale();
      if (locale == null)
      {
         locale = "en_US";
      }
      m_localeDateFormat = DateFormat.getDateInstance(DateFormat.SHORT, new Locale(locale));
   }
852870
@TargetApi(Build.VERSION_CODES.KITKAT)
	// (http://stackoverflow.com/questions/19834842/android-gallery-on-kitkat-returns-different-uri-for-intent-action-get-content)
    @SuppressLint("NewApi")
	public static String getPath(final Context context, final Uri uri) {
        final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;

        // DocumentProvider
        if(isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
            // ExternalStorageProvider
            if(isExternalStorageDocument(uri)) {
                final String docId = DocumentsContract.getDocumentId(uri);
                final String[] split = docId.split(":");
                final String type = split[0];

                if("primary".equalsIgnoreCase(type)) {
                    return Environment.getExternalStorageDirectory() + "/" + split[1];
                }
            } else if(isDownloadsDocument(uri)) {
                final String id = DocumentsContract.getDocumentId(uri);
                if (!TextUtils.isEmpty(id)) {
                    return id.replace("raw:", "");
                }
                try {
                    final Uri contentUri = ContentUris.withAppendedId(
                            Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
                    return getDataColumn(context, contentUri, null, null);
                } catch (NumberFormatException e) {
                    Log.i(TAG,e.getMessage());
                    return null;
                }
            }
        } else if ("file".equalsIgnoreCase(uri.getScheme()) ||
                "content".equalsIgnoreCase(uri.getScheme())) {
            return uri.getPath();
        }

        return null;
    }
1246100
private void readPropertiesFiles() {

        if (this.messageFileWildcard.isEmpty() || !CoreParameters.LOG_RESOLUTION.get()) {
            // Skip configuration loading
            LOGGER.info(JRebirthMarkers.MESSAGE, "Messages Loading is skipped");

        } else {
            // Assemble the regex pattern
            final Pattern filePattern = Pattern.compile(this.messageFileWildcard + "\\.properties");

            // Retrieve all resources from default classpath
            final Collection<String> list = ClasspathUtility.getClasspathResources(filePattern);

            LOGGER.info(JRebirthMarkers.MESSAGE, "{} Messages file{} found.", list.size(), list.size() > 1 ? "s" : "");

            for (final String rbFilename : list) {
                readPropertiesFile(rbFilename);
            }
        }
    }