filepath

Velocity Not Finding Template

走远了吗. 提交于 2019-12-13 20:43:12
问题 I am trying to get Apache Velocity up and running. I have a TestClass.class class in my my.test.package package. public class TestClass { public static Template getTestTemplate() throws Exception { Velocity.init(); return Velocity.getTemplate("MyTestTemplate.vm"); } } In the same location ( my.test.package ) I have the MyTestTemplate.vm file. The above code causes an exception to be thrown, saying Unable to find resource 'MyTestTemplate.vm' . I am not sure what the issue is. Does Velocity not

NMAKE can't find include file in subfolder

纵饮孤独 提交于 2019-12-13 18:18:16
问题 Using Microsoft's NMAKE with -I option to for include paths. It works for the include files in these folders, but can't seem to find one in a named subfolder: Here's the resulting command & error message: cl /nologo /Ox /MD /EHsc /W3 /D_CRT_SECURE_NO_DEPRECATE -I "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys"; -I. "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys" "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include" "C:\Program Files (x86)

Access VBA: how to return path of file you browsed to

时间秒杀一切 提交于 2019-12-13 16:07:30
问题 I want to return the entire path of an excel file I browsed to. Using the following, Set dlg = Application.FileDialog(msoFileDialogFilePicker) dlg.Title = "Select Excel Spreadsheet to import" dlg.AllowMultiSelect = False If dlg.Show = -1 Then dataPath = dlg.InitialFileName Me!browseDataPath = dlg.InitialFileName End If I'm able to open the dialog and return the directory in which the file is located, but this code doesn't append the name of the file (e.g. blabla.xls) at the end of the path.

in java my file paths with included spaces show up as %20 and i'm not sure why

ⅰ亾dé卋堺 提交于 2019-12-13 07:54:10
问题 I have a photo selection model, but for some reason whenever I call the path of the images, the space in the path is converted to it's HTML code and I'm not sure why. Do any of you have any ideas? Thanks for any help you can spare. 回答1: It's url encoded. I dont know the java library to un-encode but I'm sure it's out there and fairly easy to use. edit - http://download.oracle.com/javase/1.4.2/docs/api/java/net/URLDecoder.html this maybe? 回答2: The specification for URLs (RFC 1738, Dec. '94)

Created zip file contain folder structure using tar command in PHP

≡放荡痞女 提交于 2019-12-13 07:18:32
问题 I am trying to create a zip of all files in abc folder with the name filename.zip using following command in php like: exec(tar -cvf filename.zip /home/public_html/uploads/abc/) but the created zip has the folder structure home/public_html/uploads. Please help me to get rid of these folders. 回答1: exec("tar -cvf filename.zip -C /home/public_html/uploads/ abc/") Note the space before 'abc/'. The -C switch tells tar to first change directory to /home/public_html/uploads and then compress 'abc'

Android How to get the root directory from a file (path)

眉间皱痕 提交于 2019-12-13 06:45:34
问题 How do I get the root directory of any path. If i have file path /storage/emulated/0/Android/media/com.google.android.talk/Ringtones/, what is the best way for me to return the root directory "storage". Is the file path always in "/" format, is that safe to split the path based on the character "/" or is there a built in function that I can call? I need to create a method to return the root files of all the audio files on the android phone. Here are some paths that I have and I want to start

How can I get a URL from relative path under a jar?

杀马特。学长 韩版系。学妹 提交于 2019-12-13 04:09:44
问题 What I have done so far is : /** Default location of help files folder */ private static final String DEFAULT_PATH = "../../../../resources/files/help/"; /** A 404 error file */ private static final String ERROR_404 = "../../../../resources/files/help/404.html"; /** * @param fileName * @return The URL of file, if found at default location, otherwise a 404 error page URL. */ public static URL getURL(String fileName) throws MalformedURLException{ URL url = (new File(ERROR_404)).toURI().toURL();

Regular expression to validate windows and linux path with extension

梦想的初衷 提交于 2019-12-13 03:47:25
问题 I am trying to write a function which will validate weather the given path is valid in Linux/Windows with file extension. ex: Windows path: D:\DATA\My_Project\01_07_03_061418738709443.doc Linux path: /source_data/files/08_05_09_1418738709443.pdf The code that I have tried is static String REMOTE_LOCATION_WIN_PATTERN = "([a-zA-Z]:)?(\\\\[a-z A-Z0-9_.-]+)+.(txt|gif|jpg|png|jpeg|pdf|doc|docx|xls|xlsx|DMS)\\\\?"; static String REMOTE_LOCATION_LINUX_PATTERN = "^(/[^/]*)+.(txt|gif|jpg|png|jpeg|pdf

Android SQLite image Storage

浪尽此生 提交于 2019-12-13 01:28:45
问题 I am making a quiz app which requires me to be able to get an image from a database BLOB or image path stored in the database. However i have looked around and a lot of people suggest using a file path, the problem is i don't know where to store the image if i use the file path method. Do i store it somewhere in the app such as the resources folder?, a lot of examples use SD cards but is it possible to save an image to SD card from a database and if so surely that would mean i have two images

contentOfFile path gives null

泪湿孤枕 提交于 2019-12-13 00:39:16
问题 I'm trying to get all the text from a txt file into a string, but if I try to NSlog() this string, i get null. I think it's because of the path i'm trying to get the file at, but I can't seem to figure out what is wrong with the path. I know that i get the right navigationItem.title, so that is not the problem. The text file is in the main bundle in a subfolder called Øvelser/Text/"nameOfExercise".txt. I have pasted my code below: - (void)viewDidLoad { [super viewDidLoad]; //Read from the