FAQ Database Discussion Community


Why I can't access my escaped URL?

java,android,url,android-asynctask,uri
I'm trying to send some params to my server in AsyncTask, but without any luck. Here is my code: try { Uri.Builder builder = new Uri.Builder(); builder.scheme("https") .authority("www.dummyurl.com/android/agent.php") .appendQueryParameter("date", selectedDate.getText().toString()+" "+ selectedTime.getText().toString()) .appendQueryParameter("user", userTxt.getText().toString()) .appendQueryParameter("cal", calTxt.getText().toString()); String myUrl = builder.build().toString(); System.out.println(myUrl); URL url = new URL(myUrl);...

Bitmap.UriSource is not getting set

c#,wpf,uri
This Works: Sending Uri directly as a parameter to the constructor sets the UriSource of the object photo. BitmapImage photo = new BitmapImage(new Uri("pack://application:,,,/Images/EmptyImage.jpg")); Doesn't Work: But setting the UriSource property keeps the UriSource as null BitmapImage photo = new BitmapImage(); photo.UriSource = new Uri("pack://application:,,,/Images/EmptyImage.jpg"); ...

WebDriver getCurrentUrl() returning malformed URI

java,selenium-webdriver,uri,url-encoding,selenium-firefoxdriver
I'm involved in writing a (Java/Groovy) browser-automation app with Selenium 2 and FireFox driver. Currently there is an issue with some URLs we find in the wild that are apparently using bad URI syntax. (specifically curly braces ({}), |'s and ^'s). String url = driver.getCurrentUrl(); // http://example.com/foo?key=val|with^bad{char}acters When trying to...

XML Namespace URI with HTTPS?

xml,xml-parsing,schema,uri,xml-namespaces
Is it better to have a xmlns URI with https protocol? For example this is the recommended way by the manual: <http xmlns="http://www.springframework.org/schema/security"/> Is it legal and better to use this way? <http xmlns="https://www.springframework.org/schema/security"/> Are there XML parsers that try to connect to an address defined by xmlns URI? Parsers...

Can you give an example of a URN for private-use

uri,web-standards,urn
According to Wikipedia, urn:<NID>:<NSS> The leading urn: sequence is case-insensitive. <NID> is the namespace identifier, which determines the syntactic interpretation of <NSS>, the namespace-specific string. The functional requirements for uniform resource names are described in RFC 1737.[5] Source: http://en.wikipedia.org/wiki/Uniform_resource_name And then it goes on to say that the experimental NID...

Android Implicit Intent for Viewing a Video File

java,android,android-intent,uri,avd
In my Android app, I have a button that when clicked, launches the external application of my choice to play a video (I gather that this is called an "implicit intent"). Here is the relevant Java code from my onCreate method. Button button = (Button) findViewById(R.id.button); button.setOnClickListener ( new Button.OnClickListener()...

Unable to resolve URI Issue Ruby URI

ruby-on-rails,ruby,wsdl,uri,savon
client = Savon.client(:wsdl => 'LOCATION OF FILE CODE OF WHICH I HAVE POSTED BELOW' Savon.call(:create_shipments, :message => some_hash) I am getting URI::InvalidURIError: bad URI(is not URI?) I did a puts in URI Library for the url the URL was - https://ws.aramex.net/shippingapi/shipping/service_1_0.svc tried to URI.parse on the same url its not...

“%” is getting URI decoded while everyhting else not

javascript,uri,sapui5,openui5,uriencoding
I have a strange UI5 problem. I create a string from a control's binding context which looks like: Entity('Element%3AInfo%2CID') Just for info, it looks like this decoded: Entity('Element:Info,ID') However, I get this String from the following method chain: oItem.getBindingContext().getPath().substr(1) So, the whole (pretty basic) "navigate to" block looks like this:...

Output Uri from this Android crop image library?

android,image,uri,crop
I'm trying to implement SoundCloud's image crop to my app. Here's what I'm doing so far: call Crop.pickImage((Activity) this) to pick an image @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == Crop.REQUEST_PICK && resultCode == RESULT_OK) { Uri inputUri = data.getData(); new...

Force forward slash to // instead of automatically combine to / in string

android,uri,filenotfoundexception,universal-image-loader
Currently, I used Image Loader Universal library to load files from File path in sdcard. I get issue with forward slash in Uri from File Path. The correct string to load file is this one : content://media/external/images/media/24415 But when I put as these codes : imageLoader.displayImage( Uri.fromFile(new java.io.File(FILE_PATH)).toString(), // .replace("%3A",...

Access iriInfo in called Method

java,jax-rs,uri
This code works to access the uriInfo: @Path("/testing") public class Testing { @javax.ws.rs.core.Context UriInfo uriInfo; @POST @Path("/test2") @Produces(MediaType.TEXT_PLAIN) public Response test2( @FormParam("sessionId") String sessionId ) { String currentUserId = Utils.setup(sessionId); String accessPath = uriInfo.getAbsolutePath().toASCIIString(); System.out.println("The client used this URI to reach this resource method: " + uriInfo.getAbsolutePath().toASCIIString()); // Utils.test3("print this");...

Rotate Image from URI and save the rotated image to the same place

android,image,bitmap,save,uri
I'm trying to create a Bitmap from an existing URI, rotate the Bitmap and save it to the same place as a JPEG file. This is my current code after having tried several solutions: try { // Get the Bitmap from the known URI. This seems to work. Bitmap bmp...

routing URI containing email in codeigniter

codeigniter,routes,uri
This is an email activation link written in user controller http:[email protected]/90101001010 I want to write routes for this. I tried the below one but its // USER POST $route['user'] = 'user'; $route['user/activate_user/:any/:num'] = 'user/activate_user/$1/$2'; Error An Error Was Encountered The URI you submitted has disallowed characters. if i run uri...

Get FileInputStream from Android content URI (or how to seek on an InputStream)

android,uri,h.264,fileinputstream,android-contentresolver
I have a video player app that plays custom h264 transport streams. I was tasked with being able to launch our player from methods such as the user opening "gallery", selecting "movies" and after selecting a movie picking our app to launch...this all works perfectly. My issue is in how...

Uri.parse(path) return null in Android 4.4.2

java,android,nullpointerexception,uri
I have an app that allow user to upload a photo on wall. The code works well for the majority of users, but I have reported that the application crashes sometimes when uploading photo. The problem is not in taking the pictures from the camera, but it is when you...

Cannot open PDF file in external app

android,pdf,uri,assets
I would like to open a PDF file when the user clicks on a button. Currently, i am using this code to achieve this: Uri path = Uri.fromFile(new File("file:///android_asset/regola11_1.pdf")); Intent pdfIntent = new Intent(Intent.ACTION_VIEW); pdfIntent.setDataAndType(path, "application/pdf"); pdfIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(pdfIntent); but it doesn't work. When i select to use Adobe Acrobat, i...

How to transfer a Uri image from one activity to another?

java,android,android-intent,bitmap,uri
In my app I need to transfer a Uri image from my first Activity to another. I know how to send a Bitmap through an intent. I'm a bigginer programmer so I don't know what would be better to do: transfer the Uri with an intent or change the Uri...

Proper URI syntax for referencing public resource file in DLL

c#,wpf,dll,uri
Says it all... I have an XAML Resource Dictionary file (text) in "Resources.resx" under the public class "Resources" accessible by the public method "Styles." I can find the resource in the standard C# method under the DLL's namespace... But my problem is when it comes to writing this: <ResourceDictionary Source="????"></ResourceDictionary>...

Does HTTP URL parameter order matter for caching? [closed]

http,caching,seo,uri,url-parameters
Are the two URLs equivalent with respect to browser caching and website seo? 1 - http://example.com/resource.html?a=a&b=b 2 - http://example.com/resource.html?b=b&a=a If the resource for the first URL is cached and the browser needs to find the resource for the second URL can it use the cached resource? I want to know...

uriBuilder returns http:/ instead of http://

java,url,jersey,uri
I use this code: UriBuilder builder = UriBuilder .fromPath(Constants.LIVEMAP_BASE_URL_US) .scheme("http"); return builder.build().toString(); how can it be that it has generated "http:/" instead of "http://" ? returned value = http:/livemap-tiles1.waze.com/tiles/internal?lineGeom=......

URI schemes for Add new and Edit contact in windows phone 8.1

windows-phone-8,uri,contact
I am a newbie in windows phone programming. I am looking for a way to call "Add new contact" and "Edit contact" by clicking a button. One solution for this is used Windows.System.Launcher.LaunchUriAsync(new Uri(“ms-settings-bluetooth:”));. However in this list of URI schemes (https://msdn.microsoft.com/en-us/library/windows/apps/jj662937(v=vs.105).aspx) , there is no thing what I am...

Getting parts of a URI

c#,uri
Lets say I have this code: Uri uri = new Uri("www.xx.yy.co.uk/folder/whatever.html"); How can I get xx , yy , co.uk from a Uri in C# ? I tried nearly every property of Uri class and I didn't find anything relevant. Note that, for example, com and co.uk are both a...

How to get access token from the url [duplicate]

javascript,jquery,url,uri
This question already has an answer here: Parsing URL hash/fragment identifier with JavaScript 7 answers I'm getting this URL after I'm authenticated to Google http://localhost:3000/_oauth/google#access_token=ya29.5HxuYol1Io8JLeGePDznbfkkwu_PC4uodKwG8_1clFYAn9AgdOV1WGpOTNQP3s76HAsn7Y4zWw&token_type=Bearer&expires_in=3600 How to get access_token value from this url? I tried solutions in following urls, none of them are working How can I get query...

hadoop fs -ls results in “no such file or directory”

hadoop,uri,hdfs
I have installed and configured Hadoop 2.5.2 for a 10 node cluster. 1 is acting as masternode and other nodes as slavenodes. I have problem in executing hadoop fs commands. hadoop fs -ls command is working fine with HDFS URI. It gives message "ls: `.': No such file or directory"...

Setting facebook's profile picture as a LinearLayout background

android,facebook,background,uri,profile-picture
I have been trying with no avail to set my facebooks profile picture as a Linearlayout background in my application. here are the two ways I tried to do this: first way: got the uri from the profile picture and converted it to drawable protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);...

Retrieve correct file URI in Java [duplicate]

java,scala,url,uri
This question already has an answer here: Java : File.toURI().toURL() on Windows file 3 answers The .toString method of java.net.URI does not encode local file URLs correctly. scala> new java.io.File("/tmp/d.jpg").toURI.toString res0: String = file:/tmp/d.jpg Why does the URI not generate? file:///tmp/d.jpg Edit I discovered this while passing a file...

Android contact image placeholder in listview

android,file,uri,contacts,android-contacts
I have an activity with a listview and a custom adapter. Retrieving the contact information and the image is not the problem. I can not display an alternative image if there is not one for the contact. Checking if the URI is NULL does not work for me. I am...

Why doesn't the subtype of this custom MIME type specify the particular row (from Content URI) in the table?

android,uri,android-contentprovider,mime-types
AT the end of the developer guide, they have described vnd.android.cursor.dir to be the type part of every custom MIME type, for multiple rows; and vnd.android.cursor.item for a single row. Then there is an example of a Content Provider that contains train timetables. It's authority is com.example.trains and it has...

Android content uri id as string

android,mongodb,sqlite,uri,android-contentprovider
In my Android app i use SQLite with content provider. For some (backend) reasons, my tables have _id primary key as VARCHAR. The problem is: I need to use content uri with appended id. In all examples what i saw content uri with id looks as content://<autority>/<model_or_table>/<long_id> and adds to...

URI escape / unescape from Javascript to Perl

javascript,perl,escaping,uri
I have an URL that javascript reads from an user input. Here is a part of javascript code: document.getElementById("Snd_Cont_AddrLnk_BG").value=encodeURI(document.getElementById("Con_AddresWeb_BG").value.toString()); Then I post the value of the string through CGI to a Perl Script (here is a part of perl code): #!/usr/bin/perl -w ## ## use strict; use CGI; use CGI::Carp...

WPF XAML two buttons that change webbrowser url on a different window

c#,wpf,xaml,webbrowser-control,uri
I cannot seem to get my two buttons on Window2 to successfully change the webbrowser url on my main window. All I want to do is click button one and go to one address, and click the other button and go to a different address. I've tried binding without any...

getIntent().getData() == null for unity app

android,android-intent,android-activity,unity3d,uri
so Im running a java plugin that extends UnityPlayerActivity. Im successfully overwriting the onCreate function. Only problem is when I try to get the intent data coming in, its null. The data Im looking for is the url that Triggered the Intent. package com.company.androidlink; import java.net.URL; import android.content.Intent; import android.net.Uri;...

Open browser with a url with extra headers for Android

java,android,uri
I have a specific requirement where I have to fire a url on the browser from my activity. I am able to do this with the following code : Intent browserIntent = new Intent( Intent.ACTION_VIEW, Uri.parse( pref.getString("webseal_sso_endpoint", "") + "?authorization_code=" + code + "&webseal-ip=" + websealIP ) ); activity.startActivity(browserIntent); activity.finish();...

Opening a non-default browser in Java

java,browser,uri
So I understand that using the method: Desktop.getDesktop().browse(URI.create("http://www.stackoverflow.com/")); I can open a webpage with my default browser, but is there a way I can specify a path to a non-default browser and open a url with that one? ie. my default is Chrome, but I want to open in Mozilla...

how to parse a url with json options in it?

json,curl,uri
Like the title says, I'm trying to parse a url like the following: https://salzundbrot.com/suche/#!search={"s1":60,"s2":90,"r1":2,"r2":4,"f1":450,"f2":750,"c":3}&x=1&view=infotiles curl throws the following error: $ curl https://salzundbrot.com/suche/#!search={"s1":60,"s2":90,"r1":2,"r2":4,"f1":450,"f2":750,"c":3}&x=1&view=infotiles -bash: !search={/"s1/": event not found ruby's uri module can't handle it either, throwing a bad URI(is not URI?) error. Single quotes don't work, escaping the double quotes doesn't...

Can a REST resource point/wrap another external REST API? [closed]

rest,http,uri,restful-url
I would like to have a URI like this /car/toyota, however I don't want the car resource to map to a database table for example. Instead I would like car to just be resource that is used for information retrieval only (ie. no POST, PUT, or DELETE on it), and...

Are there any security implications of identifiers in URL path elements?

security,rest,uri,query-string
I'm implementing a Rails app using Devise for most of the user authentication work. One thing I've noticed is that, when passing identifiers around for security-sensitive tasks, they're always done using query string parameters. For example, the URL included in the password reset email sent to users might look something...

Difference between `URI` and `URI.parse`

ruby,url,uri
What is the difference between URI and URI.parse? Here is what I get: require 'uri' x = "http://google.com" y = URI(x) # => #<URI::HTTP http://google.com> z = URI.parse(x) # => #<URI::HTTP http://google.com> y == z # => true I see in the docs that a new instance of URI creates...

Obtain a URI using a session or server variable in PHP

php,uri
I want to obtain this part of my URI and assign it to a variable. <?php $_SESSION[''] = 'http://www.devin-gray.webportfolio.capetown/cvnewsletter/'; ?> is it possible to use a $_SESSION or a $_SERVER function to do this?...

How to display an ImageView on the whole screen on android?

java,android,imageview,uri
In my app I need to take a pic from the gallery(I have working code for that, that gives me the Uri of the pic) and place the Uri in an ImageView. The problem I'm running into is that the pic is not covering the whole screen like I want...

Why not displayed in the console, a group of links to resources Ruby

ruby-on-rails,ruby,uri
Why not displayed in the console, a group of links to resources Ruby require 'open-uri' url = 'http://www.google.com/search?q=ruby' open(url) { |page| page_content = page.read() links = page_content.scan(/<a class=1.*?href=\"(.*?)\"/).flatten links.each { |link| puts link } } Console output blank line E:\work\storeapp3\app\storeapp\shop>ruby robota_z_fail.rb Where am I wrong?...

URL with é (e acute)

android,uri,httpurlconnection,urlencode
I've a problem with a url format. I would like make a get request from the url: 'http://www.radiobébé.com/titre.txt' (http://www.radiobebe.com/titre.txt doesn't exist) String responseBody = ""; try { URL u = new URL("http://www.radiobébé.com/titre.txt"); HttpURLConnection urlConnection = (HttpURLConnection) u .openConnection(); urlConnection.setRequestMethod("GET"); urlConnection.connect(); int statusCode = urlConnection.getResponseCode(); if (statusCode == HttpURLConnection.HTTP_OK) { responseBody...

Apache URI path recognition / mapping?

apache,uri,virtual-directory
I have a website for all intents and purposes is called. www.foobar.com Which in my server path is /var/www/ I tried to create a new folder in /var/ called "analytics", with the hope that if I typed www.foobar.com/analytics I could access that folder. However that does not work because it...

HTML instead of URI encoding in regard to XSS?

html,encoding,uri,xss
I'm inserting untrusted data into a href attribute of an tag. Based on the OWASP XSS Prevention Cheat Sheet, I should URI encode the untrusted data before inserting it into the href attribute. But would HTML encoding also prevent XSS in this case? I know that it's an URI context...

The difference between authority and scheme in an Android URI

android,uri,android-contentprovider,authority
What is the difference between URI authority and URI scheme in Android? I always use scheme in URI to indicate database table as follow: content://scheme I using custom search suggestion in my application, I read document about search custom suggestion in which authority used instead of scheme to reference database...

Setting a valid Azure AD uri for PhoneGap

cordova,mobile,oauth-2.0,uri,azure-active-directory
I am working on a mobile app, using the PhoneGap framework. For the next part of the project, I need to allow users to authenticate themselves through their Windows 365 account of the company. For this I'm using Azure AD, with the following AngularJS based library. I have already succeeded...

CodeIgniter : Routing URL on Codeigniter

php,codeigniter,routes,uri
Hey guys I just learned about routing in CodeIgniter and now I am lil bit confuse. I have an URL like this : http://localhost/norwin/list_group/get_product_by_group/1 which is : list_group is controller, get_product_by_group is method, and '1' is passing parameter. I want to minimize the URL with route. So I can have...

Codeigniter delete last “/” in url

php,codeigniter,url,uri
I tried a lot of solutions but nothing works. i'm searching for a good one for my problem: In my view i have to put a link like that : <?php $id = 100; ?> <a href="<?php echo site_url($id); ?>"> Click </a> The echo here will show https://www.domain.com/folder/100 ,but what...

How to detect URL to different page (also in the same domain)

java,url,uri,jsoup
I have question about detect url in page. I'm founding the best way how it solve. For downloading page I use Jsoup. URI uri = new URI("http://www.niocchi.com/"); Document doc = Jsoup.connect(uri.toString()).get(); Elements links = doc.select("a") And this page get me some links. For example this: http://www.niocchi.com/#Package organization http://www.niocchi.com/#Architecture http://www.linkedin.com/in/ivanprado http://www.niocchi.com/examples/...

REST convention for parent insert and parent + joinId insert using same endpoint

rest,uri,naming-conventions
In context of an event management system where speakers are talking at different sessions. My entities are Speakers and Sessions Let's say the endpoint is 1) POST /speakers (to insert detail of a speaker ONLY) 2) POST /speakers (to insert detail of speaker + id of the session he's talking...

Correct url encoding in jvm languages

java,regex,apache,uri
I know that there are dozens of similar topics, but I didn't found smth useful to answer my question. Suppose I have an url http://example.com/a/b?param1=1&param2={"a": "b"}&param3="&=+%" + and = signs don't get encoded when using apache UriUril.encodeQuery. When using URLEncoder.encode they do get encoded but in that case I have...

some more help for naming conventions plural vs singular

node.js,rest,resources,uri,naming-conventions
There are answers out there but my question is different as I'm trying to find out a uri when I've detail on a product or when I've to return detail on a product plus it's customers. I need a standard solution for following 4 api calls. I need a standard...

Is there a hostname moniker for URI with serverless bindings?

.net,uri,uribuilder
I am constructing a URI for an LDAP connection. I know Microsoft does support serverless binding using ldap:///cn=... notation, and that URI will work with .NET, but UriBuilder will not produce a correct URI if port is specified. For example: var ub = new UriBuilder(); ub.Scheme = "ldap"; ub.Host =...

NFC Read Tag SMS Service

android,sms,uri,nfc,ndef
I have written a program in which I am trying to write and read NFC tag, which may help user in sending message. I have successfully written to the tag but whenever I am trying to read, the Tags app shows vnd.android.nfc://ext/nfclab.com:smsService but does not allow me to send the...

How to set image URI in HashMap

java,android,image,hashmap,uri
I am building a listview and i get the URI of an image wich i want to a HashMap using map.put. The functions to get the URI works fine i can set an image View using setImageURI(uri). What value should i use in the map.put("flag", value); The following code is...

How to getCropAndSetWallpaperIntent(Uri imageUri) to work?

android,android-intent,uri,android-wallpaper
So, there are two questions that are the same as this( How to use getCropAndSetWallpaperIntent method in WallpaperManager? AND How to use getCropAndSetWallpaperIntent? ), but there are no answers to both of them. In hope of an answer I'm asking this - how to get this method to work. http://developer.android.com/reference/android/app/WallpaperManager.html#getCropAndSetWallpaperIntent(android.net.Uri)...

Converting a File:///… string to an Absolute URI

java,android,uri,filepath,absolute-path
So I am making an app that lets users pick images from their gallery to display, as well as take photos from the camera. The image is previewed via a bitmap that takes the string of the file path. When the user takes a photo the code below handles it...

Using Regex to parse a URI

javascript,jquery,regex,url,uri
I'm currently using Modenizr to determine what link to serve users based on their device of choice. So if they're using a mobile device I want to return a URI if not then just return a traditional URL. URI: spotify:album:1jcYwZsN7JEve9xsq9BuUX URL: https://open.spotify.com/album/1jcYwZsN7JEve9xsq9BuUX Right now I'm using slice() to retrieve the...

What does the error “java.lang.IllegalArgumentException: URI i s not hierarchical” mean?

java,jar,uri
I have an java application, that is decoding information on a image using an xml file. The xml file is in the top most package. This is the code I am using to get the file java.net.URL url = DecodeButton.class.getResource("/text.xml"); File process_file = new File(url.toURI()); The code is working fine...

How do you interpret this URL time format?

xml,url,uri,datetime-format,time-format
I have rather lengthy URL that I am using in an application to receive XML data. I'd like to manipulate the time in the URL based on the users time but I don't know how to interpret it. Here's the date and time from the URL: 2015-04-27T00%3A00%3A00 My Question: Is...

Why is this URI valid by RCF 2396 standards?

java,uri
I was playing around with non stringy types for an application loader i've been developing. As a typo, I forgot to include the protocol part of a specific URI. I expected the java test to fail due to an invalid URI... however this statement seems to work... URI uri =...