uri

Apache Rewrite Issue, Custom URI

谁说我不能喝 提交于 2019-12-25 04:41:18
问题 I have a solution but it is one that I know is not the greatest and would better be solved with a full rewrite. Basically I have 3 rewrites that will go to the correct areas I want and do what they need to do. However in order to switch between where I need to go I had to write a URI class to strip through the url set the page and vars manually. It all works out great but the urls are a pain in the ass specially if not formatted exactly. RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f

Creating images in SVG and rendering them in HTML using Base64 encoding URI and JAVA

断了今生、忘了曾经 提交于 2019-12-25 04:08:16
问题 I am trying to create a service that returns SVG. The requirement is that the SVG has to work in an img tag (script tag would be a bonus) and also to avoid JavaScript. I have figured that encoding the img in BASE 64 and using it as a URI ,is my best bet. Java Servlet String imageString = g2.getSVGElement(); // creates svg html string e.g <svg> blah blah</svg> byte[] imageData = Base64.encodeBase64(imageString.getBytes()); OutputStream out = response.getOutputStream(); out.write(imageData);

MediaStore.Images.保存图片时生成两张图片的问题 并且在oppo手机上时间是1970-01-01 08:00:00

萝らか妹 提交于 2019-12-25 03:47:39
MediaStore.Images.保存图片时生成两张图片的问题 并且在oppo手机上时间是1970-01-01 08:00:00 正确方式如下 使用方式一 private void saveImage ( String originFilePath ) { File appDir = new File ( Environment . getExternalStorageDirectory ( ) . getPath ( ) + "/leikebaijing/images" ) ; if ( ! appDir . exists ( ) ) appDir . mkdirs ( ) ; String fileName ; long dateTaken = System . currentTimeMillis ( ) ; if ( originFilePath . contains ( "/" ) ) { fileName = originFilePath . substring ( originFilePath . lastIndexOf ( "/" ) + 1 ) ; } else { fileName = dateTaken + "jpg" ; } File file = new File ( appDir , fileName ) ; if ( ! file . exists (

Silverlight WebRequest fails with “The URI prefix is not recognized”

让人想犯罪 __ 提交于 2019-12-25 02:44:47
问题 I have a silverlight library that is supposed to get make a web service request and receive an xml response: Uri uri = new Uri("http://some_server:51306/getStuff.xml?id=14"); WebRequest request = WebRequest.Create(uri); However, WebRequest.Create(uri) fails with the exception "The URI prefix is not recognized". Note that I am running the program using a unit test from a non-silverlight dll. I need to build a test suite for the app! Any ideeas? 回答1: Try setting the .Web project as the default

Getting permission denied when using a URI despite FLAG_GRANT_READ_URI_PERMISSION being set

末鹿安然 提交于 2019-12-25 02:38:12
问题 I have two android apps A and B. I am passing a file from app A to app B and I am seeing that app B is getting the URI. I am setting the FLAG_GRANT_READ_URI_PERMISSION flag in app A and I am seeing that that mFlags is a 1, which is the value of FLAG_GRANT_READ_URI_PERMISSION , from within app B. This is all good, but when I try to create a FileInputStream from the URI, I get a FileNotFoundException (Permission denied) exception. What am I doing wrong? Here are the pertinent code snippets: In

Getting permission denied when using a URI despite FLAG_GRANT_READ_URI_PERMISSION being set

心不动则不痛 提交于 2019-12-25 02:38:08
问题 I have two android apps A and B. I am passing a file from app A to app B and I am seeing that app B is getting the URI. I am setting the FLAG_GRANT_READ_URI_PERMISSION flag in app A and I am seeing that that mFlags is a 1, which is the value of FLAG_GRANT_READ_URI_PERMISSION , from within app B. This is all good, but when I try to create a FileInputStream from the URI, I get a FileNotFoundException (Permission denied) exception. What am I doing wrong? Here are the pertinent code snippets: In

ExifInterface returns null for all Tags

余生长醉 提交于 2019-12-25 02:25:10
问题 I have a problem with my class, when i call .getMake(); it always returns null, so I get the string "No Data". I know that Uri is not null because i get ther first Toast every time, with the uripath. I also know that the image has the tag "TAG_MAKE" (I checked it). It even didn't work with all the other tags. What should I change? public class ExifE { private Uri uri; private ExifInterface exifI; private Context context; public ExifE(Context con) { context = con; SharedPreferences prefs =

How to get a proper folder handle from a URI in Java?

我是研究僧i 提交于 2019-12-25 02:16:12
问题 I noticed a little issue. What my application gets is a URI of a file e.g. file:///C:/temp/somefolder/somedocument.txt as a String. What my application has to do is check the folder for more files and process them. To do that, I'd normally do something like File file = new File(myURI); File folder = file.getParentFile(); File[] peers = folder.getParentFile().listFiles(); Unfotunately, this doesn't seem to work at all when you use URI's. .listFiles always returns null, even if I open a File()

Remove last segment of an URI in Ruby

只谈情不闲聊 提交于 2019-12-25 00:35:31
问题 I'm trying to remove the last segment of a given URI using Ruby, like this: http://example.com/foo/bar/baz/?lala=foo How can I get this : "http://example.com/foo/bar/baz/" I've searched and all that I got is to get the last segment or the host part of the URI. 回答1: Based on your comment to @JorgWMittag all your really need is this s = 'http://example.com/foo/bar/baz/?lala=foo#quux' s[/.*\//] #=> "http://example.com/foo/bar/baz/" s = 'http://example.com/foo/bar.html' s[/.*\//] #=> "http:/

How can I get complex URI query string parameters in native JavaScript like in PHP?

回眸只為那壹抹淺笑 提交于 2019-12-24 21:59:58
问题 My question is about full power solution for parsing ANY complex URI parameters using just normal browser's Javascript. Like it do PHP, for simple code compatibility between JS and PHP sources. But the first, let us see some particular known decisions: 1. There is popular question and answers on StackOverflow, see How can I get query string values in JavaScript? You can find there quite simple solutions for common SIMPLE cases. For example, like handling this scalar parameters like this one: