Get property name containing the media request path
@param mediaRequest Media request
@param mediaHandlerConfig Media handler config (can be null, but should not be null)
@return Property name
320840
@SuppressWarnings("null")
  protected final @NotNull String getMediaRefProperty(@NotNull MediaRequest mediaRequest,
      @Nullable MediaHandlerConfig mediaHandlerConfig) {
    String refProperty = mediaRequest.getRefProperty();
    if (StringUtils.isEmpty(refProperty)) {
      if (mediaHandlerConfig != null) {
        refProperty = mediaHandlerConfig.getMediaRefProperty();
      }
      else {
        refProperty = MediaNameConstants.PN_MEDIA_REF;
      }
    }
    return refProperty;
  }
309563
private static URL getConfigUrl() throws ConfigurationException {
        String spec = System.getProperty(CONFIG_URL_PROPERTY_NAME);
        if (spec == null) {
            spec = DEFAULT_CONFIG_URL;
        }

        URL configUrl = null;
        try {
            configUrl = new URL(spec);
            configUrl.openStream().close(); // catches well-formed but bogus URLs
        } catch (Exception e) {
            try {
                File f = new File(spec);
                if (f.exists()) {
                    configUrl = new URL("file:///" + f.getCanonicalPath());
                }
            } catch( Exception ex) {
            }
        }

        if (configUrl == null) {
            ClassLoader loader = ServerParams.class.getClassLoader();
            configUrl = loader.getResource(spec);

            if (configUrl == null) {
                throw new ConfigurationException("Can't find file/resource: \"" + spec + "\".");
            }
        }

        return configUrl;
    }
1324292
private String buildScaledMediaUrl(Dimension dimension, CropDimension cropDimension) {
    String resourcePath = this.resource.getPath();

    // if parent resource is a nt:file resource, use this one as path for scaled image
    Resource parentResource = this.resource.getParent();
    if (JcrBinary.isNtFile(parentResource)) {
      resourcePath = parentResource.getPath();
    }

    // URL to render scaled image via {@link InlineRenditionServlet}
    String path = resourcePath + "." + ImageFileServlet.SELECTOR
        + "." + dimension.getWidth() + "." + dimension.getHeight()
        + (cropDimension != null ? "." + cropDimension.getCropString() : "")
        + (this.mediaArgs.isContentDispositionAttachment() ? "." + MediaFileServlet.SELECTOR_DOWNLOAD : "")
        + "." + MediaFileServlet.EXTENSION + "/"
        // replace extension based on the format supported by ImageFileServlet for rendering for this rendition
        + ImageFileServlet.getImageFileName(getFileName());

    // build externalized URL
    UrlHandler urlHandler = AdaptTo.notNull(this.adaptable, UrlHandler.class);
    return urlHandler.get(path).urlMode(this.mediaArgs.getUrlMode()).buildExternalResourceUrl(this.resource);
  }
1042278
private String getMainPropertyFileName() throws StartupException {
        String configLoc = getConfigLocation();
        File file = new File(configLoc == null ? MDW_PROPERTIES_FILE_NAME : (configLoc+MDW_PROPERTIES_FILE_NAME));
        if (file.exists())
            return MDW_PROPERTIES_FILE_NAME;
        URL url = this.getClass().getClassLoader().getResource(MDW_PROPERTIES_FILE_NAME);
        if (url != null)
            return MDW_PROPERTIES_FILE_NAME;
        return null;
    }
626034
private String getPropertyForGetter(String getterName) {
        if (getterName == null || getterName.length() == 0) return null;

        if (getterName.startsWith("get")) {
            String prop = getterName.substring(3);
            return MetaClassHelper.convertPropertyName(prop);
        } else if (getterName.startsWith("is")) {
            String prop = getterName.substring(2);
            return MetaClassHelper.convertPropertyName(prop);
        }
        return null;
    }
852968
@Override
    public String getVirtualHostName() {
        if (this.isNonSecurePortEnabled()) {
            return configInstance.getStringProperty(namespace + VIRTUAL_HOSTNAME_KEY,
                    super.getVirtualHostName()).get();
        } else {
            return null;
        }
    }
180264
private String getSourceName(final String property) {
        if (propertyNameMap.containsKey(property)) {
            return propertyNameMap.get(property);
        } else {
            return property;
        }
    }
1173284
@RequestCache(keyMask = {false, true})
    @Override
    public String getFolderNameForPortlet(
            HttpServletRequest request, IPortletWindowId portletWindowId) {
        final IPortletWindow portletWindow =
                this.portletWindowRegistry.getPortletWindow(request, portletWindowId);
        final IPortletEntity portletEntity = portletWindow.getPortletEntity();
        final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();

        final String fname = portletDefinition.getFName();
        final String channelSubscribeId = portletEntity.getLayoutNodeId();

        // Build the targeted portlet string (fname + subscribeId)
        return fname + PORTLET_PATH_ELEMENT_SEPERATOR + channelSubscribeId;
    }
321094
public DownloadMaterialResponse getMaterial(String mediaId) {
		DownloadMaterialResponse materialresponse = null;
        String url = BASE_API_URL + "cgi-bin/material/get_material?access_token=#";
        Map<String, String> param = new HashMap<String, String>();
        param.put("media_id", mediaId);
        BaseResponse r = executePost(url, JSONUtil.toJson(param));
        String resultJson = isSuccess(r.getErrcode()) ? r.getErrmsg() : r.toJsonString();
        materialresponse = JSONUtil.toBean(resultJson, DownloadMaterialResponse.class);
        return materialresponse;
	}
597490
public MpNews getMpNews(String mediaId) {
        String url = WxEndpoint.get("url.material.mpnews.get");

        String json = String.format("{\"media_id\":\"%s\"}", mediaId);
        logger.info("get mpnews: {}", json);
        String response = wxClient.post(url, json);
        return JsonMapper.defaultMapper().fromJson(response, MpNews.class);
    }
863688
public static ObjectName getMBeanObjectName(final ServletContext servletContext, final String resourceType,
			final String mBeanPrefix) {

		String contextPath = getContextPath(servletContext);
		return getJawrConfigMBeanObjectName(contextPath, resourceType, mBeanPrefix);
	}
194391
@SuppressWarnings("null")
  protected final @Nullable String getMediaRef(@NotNull MediaRequest mediaRequest,
      @Nullable MediaHandlerConfig mediaHandlerConfig) {
    if (StringUtils.isNotEmpty(mediaRequest.getMediaRef())) {
      return mediaRequest.getMediaRef();
    }
    else if (mediaRequest.getResource() != null) {
      String refProperty = getMediaRefProperty(mediaRequest, mediaHandlerConfig);
      return mediaRequest.getResource().getValueMap().get(refProperty, String.class);
    }
    else {
      return null;
    }
  }
1152190
static Path getSystemPropertyConfigFilePath() {
        final String path = System.getProperty(SYSTEM_PROPERTY_CONFIG_VARIABLE_NAME);
        return Paths.get(path);
    }
840667
@FFDCIgnore({ NoSuchElementException.class })
    protected Map<String, String> getMpConfig(MpConfigProxyService service, ClassLoader cl, String propertyName,  Map<String, String> map) {
        try {
            String value = service.getConfigValue(cl, propertyName, String.class).trim();
            if (!value.isEmpty()) {
                map.put(propertyName, value);
            } else {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, propertyName + " is empty. Ignore it.");
                }
            }
        } catch (NoSuchElementException e) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, propertyName + " is not in mpConfig.");
            }
        }
        return map;
    }
1188103
function FileMediatorService(mediator, config) {
  this.mediator = mediator;
  this.config = config || {};
  
  this.usersTopics = new MediatorTopicUtility(mediator).prefix(CONSTANTS.TOPIC_PREFIX).entity(CONSTANTS.USERS_ENTITY_NAME);
  this.filesTopics = new MediatorTopicUtility(mediator).prefix(CONSTANTS.TOPIC_PREFIX).entity(CONSTANTS.FILES_ENTITY_NAME);
  this.fileUITopics = new MediatorTopicUtility(mediator).prefix(CONSTANTS.FILE_UI_TOPIC_PREFIX).entity(CONSTANTS.FILE);
}
591467
public String getRequestPath() {
        Map<String,String> requestHeaders = getRequestHeaders();
        if (requestHeaders == null)
            return null;
        String path = requestHeaders.get(Listener.METAINFO_REQUEST_PATH);
        return path.startsWith("/") ? path : "/" + path;
    }
86963
public static Observable<String> getPathFromUriForMediaDocument(final Context context,
      final Uri mediaUri, final String mediaDocumentId) {
    return Observable.fromCallable(new Func0<String>() {
      @Override
      public String call() {
        String pathFound = null;
        Cursor cursor = context.getContentResolver()
            .query(mediaUri, null, Constants.ID_COLUMN_VALUE + " =?",
                new String[] { mediaDocumentId }, null);
        if (cursor != null) {
          if (cursor.moveToFirst()) {
            pathFound =
                cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.DATA));
          }
          cursor.close();
          logDebug("Path found:" + pathFound);
        }
        return pathFound;
      }
    });
  }