Returns the original source content. The only argument is the url of the original source file. Returns null if no original source content is
available.
964249
@Override
    String sourceContentFor(String aSource, Boolean nullOnMissing) {
        for (int i = 0; i < this._sections.size(); i++) {
            ParsedSection section = this._sections.get(i);
            String content = section.consumer.sourceContentFor(aSource, true);
            if (content != null) {
                return content;
            }
        }
        if (nullOnMissing != null && nullOnMissing) {
            return null;
        } else {
            throw new RuntimeException("\"" + aSource + "\" is not in the SourceMap.");
        }
    }
1310359
@Nullable
  public CharSequence getSourceCode() {
    try {
      return getPath().getCompilationUnit().getSourceFile().getCharContent(false);
    } catch (IOException e) {
      return null;
    }
  }
282139
@Override
    public String getContentType() {
	URLConnection connection = null;
	try {
	    connection = url.openConnection();
	}
	catch (IOException e) {}
	if (connection == null) return DEFAULT_CONTENT_TYPE;

	return connection.getContentType();

    }
1175508
public InputStream fetchExternalContent() {

        final URI uri = link.getUri();
        final String scheme = uri.getScheme();
        LOGGER.debug("scheme is {}", scheme);
        if (scheme != null) {
            try {
                if (scheme.equals("file")) {
                    return new FileInputStream(uri.getPath());
                } else if (scheme.equals("http") || scheme.equals("https")) {
                    return uri.toURL().openStream();
                }
            } catch (final IOException e) {
                throw new ExternalContentAccessException("Failed to read external content from " + uri, e);
            }
        }
        return null;
    }
1062343
public Object getContent() throws IOException, UnsupportedEncodingException {
		ContentTypeHeader contentTypeHeader = (ContentTypeHeader)
 			this.message.getHeader(ContentTypeHeader.NAME);
		if(contentTypeHeader != null && logger.isDebugEnabled()) {
			logger.debug("Content type " + contentTypeHeader.getContentType());
			logger.debug("Content sub type " + contentTypeHeader.getContentSubType());
		}
		if(contentTypeHeader!= null && CONTENT_TYPE_TEXT.equals(contentTypeHeader.getContentType())) {
			String content = null;
			if(message.getRawContent() != null) {
				String charset = this.getCharacterEncoding();
				if(charset == null) {
					content = new String(message.getRawContent());
				} else {
					content = new String(message.getRawContent(), charset);
				}
			} else {
				content = "";
			}
			return content;
		} else if(contentTypeHeader!= null && CONTENT_TYPE_MULTIPART.equals(contentTypeHeader.getContentType())) {
			try {
				return new MimeMultipart(new ByteArrayDataSource(message.getRawContent(),
						contentTypeHeader.toString().replaceAll(ContentTypeHeader.NAME+": ", "")));
			} catch (MessagingException e) {
				logger.warn("Problem with multipart message.", e);
				return this.message.getRawContent();
			}
		} else {
			return this.message.getRawContent();
		}
	}
900637
def get_file_content(self, path):
        
        id = self._get_id_for_path(path)
        blob = self.repository._repo[id]
        return blob.as_pretty_string()
1148040
@DefinedBy(Api.COMPILER)
    public JavaFileObject getSource() {
        if (source == null)
            return null;
        else
            return source.getFile();
    }
853967
public function getFileContents()
    {
        if ($this->fileContentsCache === null && $filePath = $this->getFile()) {
            if ($filePath === "Unknown" || !is_file($filePath)) {
                return null;
            }

            $this->fileContentsCache = file_get_contents($filePath);
        }

        return $this->fileContentsCache;
    }
510039
public String getOriginalParams() {

        if (m_originalParams == null) {
            m_originalParams = CmsEncoder.decode(CmsRequestUtil.encodeParams(getJsp().getRequest()));
        }
        return m_originalParams;
    }
715313
public static URL getSourceUrl(SourceUnit source) {
        URL url = null;
        final String filename = source.getName();
        if(filename==null) {
            return null;
        }

        Resource resource = new FileSystemResource(filename);
        if (resource.exists()) {
            try {
                url = resource.getURL();
            } catch (IOException e) {
                // ignore
            }
        }
        return url;
    }
60691
def download_file_from_url(self, source_app, url):
        
        if source_app:
            source_name = source_app
        else:
            source_name = urlparse.urlparse(url).netloc.replace('.', '_')

        filename = self.create_file_name(source_name)
        self.download_file(url, filename)
        return filename
185434
def get_file_contents(self, path):
        
        path = self._normalize_path(path)
        res = self._session.get(
            self._webdav_url + parse.quote(self._encode_string(path))
        )
        if res.status_code == 200:
            return res.content
        elif res.status_code >= 400:
            raise HTTPResponseError(res)
        return False
1317161
@Override
  public URL getURL() throws IOException {
    URL url = this.servletContext.getResource(this.path);
    if (url == null) { throw new FileNotFoundException(getDescription()
        + " cannot be resolved to URL because it does not exist"); }
    return url;
  }
50662
private String loadSource(String sourceUrl) {
        String source = null;
        int hash = sourceUrl.indexOf('#');
        if (hash >= 0) {
            sourceUrl = sourceUrl.substring(0, hash);
        }
        try {
            InputStream is;
          openStream:
            {
                if (sourceUrl.indexOf(':') < 0) {
                    // Can be a file name
                    try {
                        if (sourceUrl.startsWith("~/")) {
                            String home = SecurityUtilities.getSystemProperty("user.home");
                            if (home != null) {
                                String pathFromHome = sourceUrl.substring(2);
                                File f = new File(new File(home), pathFromHome);
                                if (f.exists()) {
                                    is = new FileInputStream(f);
                                    break openStream;
                                }
                            }
                        }
                        File f = new File(sourceUrl);
                        if (f.exists()) {
                            is = new FileInputStream(f);
                            break openStream;
                        }
                    } catch (SecurityException ex) { }
                    // No existing file, assume missed http://
                    if (sourceUrl.startsWith("//")) {
                        sourceUrl = "http:" + sourceUrl;
                    } else if (sourceUrl.startsWith("/")) {
                        sourceUrl = "http://127.0.0.1" + sourceUrl;
                    } else {
                        sourceUrl = "http://" + sourceUrl;
                    }
                }

                is = (new URL(sourceUrl)).openStream();
            }

            try {
                source = Kit.readReader(new InputStreamReader(is));
            } finally {
                is.close();
            }
        } catch (IOException ex) {
            System.err.println
                ("Failed to load source from "+sourceUrl+": "+ ex);
        }
        return source;
    }
713394
public String getSource()
	{
		final Element element = getElement("Source", 0);

		if (element != null)
			return element.getText();
		else
			return null;
	}
1062539
def _GetURLContent(url):
    """"""
    response = urllib_request.urlopen(url)
    encoding = response.info().get('Content-Encoding')
    if encoding == 'gzip':
        content = _Gunzip(response.read())
    else:
        content = response.read()
    return content
188121
@Override
    public String getContent() {
        FileReader reader = null;
        try {
            reader = new FileReader(this.contentFile);
            return IOUtils.toString(reader);
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            IOUtils.closeQuietly(reader);
        }
    }