relative-path

How to find USB storage path programmatically?

老子叫甜甜 提交于 2019-12-07 08:44:43
问题 I connected USB storage to my phone and I used getExternalFilesDirs(""); to find all directories including sdcard and USB. The path of sdcard comes out correctly, but USB path does not come out by the function. Is there anyway to find relative path of USB instead of absolute path? I've been stuck at this problem for few weeks, but got nothing. 回答1: Due to Android permissions you may not be able to do this, but here's the recommendation anyways. Try to read the contents of /proc/mounts and

Relative Paths in Eclipse

一个人想着一个人 提交于 2019-12-07 07:09:52
问题 I have an Eclipse workspace that is checked into a Subversion repository. However, if I change the name of the workspace directory, the project files don't load and I have to re-import them, as well as set any workspace related settings again. Does Eclipse work with relative paths? I am not the only team member on this project, and unfortunately the other guy refuses to follow a common directory organization scheme. EDIT These are all java projects at this point EDIT There are several files

Relative paths in spring classpath resource

戏子无情 提交于 2019-12-07 06:10:40
问题 I have a bunch of spring config files, all of which live under the META-INF directory in various subpackages. I have been using import like the following... <import resource="../database/schema.xml"/> So a relative path from the source file. This works fine when I am working with a local build outside of a jar file. But when I package everything up in a jar then I get an error that it cannot resolve the URL resource. If I change the above to an absolute path (with classpath:) then it works

getResource with parent directory reference

你离开我真会死。 提交于 2019-12-07 04:20:59
问题 I have a java app where I'm trying to load a text file that will be included in the jar. When I do getClass().getResource("/a/b/c/") , it's able to create the URL for that path and I can print it out and everything looks fine. However, if I try getClass().getResource(/a/b/../") , then I get a null URL back. It seems to not like the .. in the path. Anyone see what I'm doing wrong? I can post more code if it would be helpful. 回答1: The normalize() methods (there are four of them) in the

wkhtmltopdf relative paths in HTML with redirected in/out streams won't work

笑着哭i 提交于 2019-12-07 03:18:25
问题 I am using wkhtmltopdf.exe (version 0.12.0 final) to generate pdf files from html files, I do this with .NET C# My problem is getting javascript, stylesheets and images to work by only specifying relative paths in the html. Right now I have it working if I use absolute paths. But it doesn't work with relative paths, which makes the whole html generation a bit to complicated. I have boiled what I do down to the following example: string CMDPATH = @"C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf

Path of current PHP script relative to document root

倾然丶 夕夏残阳落幕 提交于 2019-12-06 23:11:24
问题 TL;DR : What alternatives to the last code sample on this page are there when trying to use relative links on pages included with PHP's include command? I'm trying to include() a file that links to a .css document, the problem is that I need to include this file from multiple (different) directories. My directory structure looks somewhat like this: www ├── (getpath.php) │ ├── css │ └── style.css ├── php │ └── header.php └── content ├── index.php └── posts └── index.php (I'm including header

Relative Path tilde (~) not working in ASP.NET MVC 4

醉酒当歌 提交于 2019-12-06 15:22:51
When I run my project on my machine, it runs on http://localhost:53998/ but when I deploy it to http://test.myserver.com/MyApp/ all links break. I'm using the relative path tilde ( ~ ), so a navigation link would be something like: <a href="~/SomeCtrl/Index">Some Action</a> On localhost, this works fine (when root is / ), but when I deploy my project under /MyApp/ it links the action to http://test.myserver.com/SomeCtrl/Index instead of http://test.myserver.com/MyApp/SomeCtrl/Index so I always get a 404. Isn't this what the tilde ( ~ ) should take care of? Am I doing something wrong here? EDIT

PHP fopen filename. Is it relative or absolute?

若如初见. 提交于 2019-12-06 12:46:19
问题 I'm having problems with my paths and fopen with reference to my web server. I have a file saved in public/dan/new/apps/lovescopes/thisfile.php . thisfile.php will create a new file in public/internalServer/lovescopes/xml/2009/12 using fopen "x+". Now my errors show in the line where fopen is: If I type in the path as relative like ../../../../internalServer/lovescopes/xml/2009/12 I end up with a Permission Denied error. If I type an absolute path like /public/internalServer/lovescopes/xml

Regex to replace relative link with root relative link

喜欢而已 提交于 2019-12-06 12:40:08
问题 I have a string of text that contains html with all different types of links (relative, absolute, root-relative). I need a regex that can be executed by PHP's preg_replace to replace all relative links with root-relative links, without touching any of the other links. I have the root path already. Replaced links: <tag ... href="path/to_file.ext" ... > ---> <tag ... href="/basepath/path/to_file.ext" ... > <tag ... href="path/to_file.ext" ... /> ---> <tag ... href="/basepath/path/to_file.ext" .

How to reference a .css file from a view (.jsp) in Spring MVC?

我们两清 提交于 2019-12-06 10:41:11
This is the structure: (they're in the same directory!) Directory |-view.jsp |-stylesheet.css When I do <link href="stylesheet.css" rel="stylesheet" media="screen"> The .css file does not get referenced correctly, i.e. I have no idea what path to set to get to it (if put as a URL in the browser, I get a 404). I guess it gets translated as http://localhost:8080/myApp/stylesheet.css and then there is no mapping defined for it. Logging says: WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/myApp/stylesheet.css] in DispatcherServlet with name