Check for URL validity

Ive done a quick google, and there are several methods by which to do this, but seem to tend towards http URLS.
Essentially i just need to check if an ftp address is valid. i.e. There is a server there that responds in some fashion.
Connection isnt necessary.
Thanks

JamesBarnes wrote:
Essentially i just need to check if an ftp address is valid. i.e. There is a server there that responds in some fashion.
Connection isnt necessary.Yes, it is. The only way to tell if there's an ftp server responding at some address and port is to connect to it.
It's generally pointless to do these kinds of tests. If the URL class provides validation of the format, take what you can get there to see if it at least could be legal vs. is clearly totally bogus, but other than that, just try to connect. If you can, it's valid. If you can't, then either the server is not running or there's no network path to it. Diagnosing that is outside the scope of your application. (Unless you're writing a network services monitoring/management tool.)
Even if you had some separate test and it succeeded, between the time that test passes and you try to connect, the server could shut down or a network problem could develop, so you cannot assume that just because the test passes, you can connect. Your connection and usage code will still have to handle communication failures.

Similar Messages

  • Regex for URL Validation

    HI I am validating a field which takes a url as input from the user.So the url may contain http,https,ftp links or the user may specify the ip address.So can anyone please help me out to create a suitable regex for that.I just need to check the validness of link and not that it exists or not.

    here i have changed the regex as suggested by you but
    it returns true even for http://com.com@
    which is invalid.
    So it did not worked :-(It did not work, because you did not use it correct:
    public class Foo {
        private static boolean isValidUrl(String url) {
            return url.matches("(https?|ftp)://www\\.\\w+\\.\\w+");
        public static void main(String[] args) {
            String[] urls = {
                    "http://com.com@",
                    "http://www.com.com",
                    "http://www.com.nl",
                    "http://www.com.co.uk",
                    "http://www.com"
            for(String url : urls) {
                System.out.println(url+" valid? "+isValidUrl(url));
    }

  • Global automatic check for "process valid after_YYYYMMDD" available?

    Hi, I want to attach the info that a process is only valid after a specific date. Each time a process-instance will be created it has to be checked if the actual date is higher than the date specified and only then the process-instance can be created.
    Is there a way to define a automatic global check of the validity of each process?
    Thanks, Soja.
    PS: I could simply define an additional variable in the deployment descriptor but that would require that each process has to check in it's first activity the actual date and the validity-date of the process.

    thanks for the reply . i have found the way to push the command to client using intune but the issue is with the command its not working.
    %programfiles%\Microsoft\OnlineManagement\Updates\Bin\omupdclt.exe /detectnow
    · %programfiles%\Microsoft\OnlineManagement\Updates\Bin\omupdclt.exe /updatenow
    These commands are not getting executed at the client machine.i tried it's execution in administrator mode.Command is  getting executed without any error but check for update is not getting initiated .
    can u please provide me with the way to execute this manually at the client machine. 
    thanks 
    Mayank Pahan

  • Checking for a valid date

    I have a program that takes a user's input from three text boxes to make a date. I need to be able to check to make sure that the day of the month is correct. For example if they enter 02/35/02 an error message should apear. I am trying to use a Calendar object to do this with but it isn't working. Here is my code:
                    String strMonth = month.getText();
              int intMonth = Integer.parseInt(strMonth);
              if ( (intMonth < 1) || (intMonth > 12) ) {
                   invalidDate("month",month.getText());
                   month.requestFocus();
                   return;
              else if(strMonth.length() == 1) {
                   strMonth = "0" + strMonth;
              //Formating the year
              String strYear = year.getText();
              int intYear = Integer.parseInt(strYear);
              if (strYear.length() == 1) {
                   //User entered only one digit
                   strYear = "200" + strYear;
              else if(intYear > 40) {
                   //User entered a year greater than 40 so must be 19??
                   strYear = "19" + strYear;
              else {
                   //If neither of the above then must be 20??
                   strYear = "20" + strYear;
              intYear = Integer.parseInt(strYear);
    //-----------RIGHT HERE IS MY PROBLEM------------------------------          
              //Check the day field using the month and year
              String strDay = day.getText();
              int intDay = Integer.parseInt(strDay);
              Calendar cal = Calendar.getInstance();
              cal.clear();
              cal.set(Calendar.MONTH,intMonth);
              cal.set(Calendar.YEAR,intYear);
              cal.set(Calendar.DAY_OF_MONTH,intDay);
              int min = cal.getMinimum(Calendar.DATE);
              System.out.println("Min Day: " + min);
    //-------------The variable max is always 31----------------------          
                    int max = cal.getActualMaximum(Calendar.DATE);
              System.out.println("Max Day: " + max);
              if( (intDay < min) || (intDay > max) ) {
                   //User entered an invalid date
                   invalidDate("day",strDay);
                   day.requestFocus();
                   return;
              else {
                   //User entered a valid date
                   if(strDay.length() == 1) {
                        strDay = "0" + strDay;
              //Everything is correct
              requestedDate = strMonth + "/" + strDay + "/" + strYear;
              System.out.println("All correct: " + requestedDate);The problem is that when I do this the variable max that I use to get the maximum day in the month is always 31. I would appreciate any help.

    import java.util.*;
    import java.text.SimpleDateFormat;
    public class Test {
      public static void main(String args[]) {
        GregorianCalendar c = new GregorianCalendar();
        c.set(Calendar.MONTH, 9);
        c.set(Calendar.YEAR, 2002);
        c.set(Calendar.DATE, 40);
        SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
        System.out.println("Date is "+sdf.format(c.getTime()));
        GregorianCalendar tmp = new GregorianCalendar();
        tmp.setTime(c.getTime());
        tmp.add(Calendar.MONTH, 1);
        tmp.set(Calendar.DATE, 1);
        tmp.add(Calendar.DATE, -1);
        System.out.println("Days="+tmp.get(Calendar.DATE));
    }

  • Check for Failed Validation

    Hi,
    Is there any value in session or any where else, that can be checked to see if ANY validation has failed?
    I have a report flag that needs to be reset if ANT validation has failed, so that the report will not continue to run.
    Thanks,
    Keisha

    Take a look at apex_application.g_inline_validation_error_cnt
    http://www.talkapex.com/2010/06/conditional-validations-in-apex.html

  • How to extends JSpinner to check for input validation.

    I have JSpinner instantiated with a SpinnerNumberModel. If I enter a number for example 123 I am happy with it. However if enter 12a3, I would like the spinner to the notify the user of the error, instead of parsing the number to just 12.
    Thank you.

    The text component of a JSpinner that uses numbers is a called a NumberEditor and is an inner class of JSpinner. You can read the API here
    It uses a JFormattedTextField to accept input, and you would do well to read the API on this as well. You may need to substitute a plain JTextField with a DocumentListener, but I haven't tried this so can't fully vouch for this.
    oh, and as always, please simply ignore alexxzius.
    Edited by: Encephalopathic on Jul 4, 2008 11:25 AM

  • LabVIEW DSC 8.0 examples that deal with events check for valid timestamp.Why?

    Hi folks !
    There are examples that come with LabVIEW DSC 8.0 that deal with alarm events, In these examples - DSC Alarms Event Structure Support.vi contained in DSC Alarms Demo.lvproj, for instance - when an alarm event occurs, the code checks for a valid time stamp - 17:00:00.000 31/12/1975. I´m confused, can anyone help me understanding why it´s done?
    Thanks !

    Hello marc8470,
    Each Virtex 5 FPGA bank requires an external voltage reference.  The FlexRIO FPGA module provides this reference in the form of Vccoa and Vccob.  Because there are two voltage references available on the FlexRIO FPGA module, each Vcco reference is connected to 2 IO banks.  The Adapter Module Interface and Protocol chapter of the FlexRIO MDK manual has a table that indicates which GPIO banks are referenced to which Vcco reference.  The Vcco levels set in the general section of the adapter module configuration file are not used by the Xilinx compiler, but instead by the fixed FlexRIO logic to configure the external voltage references.  The IO standard constraints section of the adapter module configuration file is used during compile to configure the output drivers in the Virtex 5.  If the general VccoALevel and VccoBLevel values do not match the IO standard constraints, no error will occur during compile, but the hardware will not be configured correctly during runtime.  The logic families used by each general purpose IO (GPIO) line must match that of the Vcco levels set in the general section of the adapter module configuration file.  A mismatch in values could result to incorrect behavior or possible damage to the FlexRIO FPGA module or the adapter module. 
    In the future, please use the email address included in your NI FlexRIO Adapter Module Development Kit (MDK) User Manual to send your questions directly to the FlexRIO MDK support team.  This group has experience with specific FlexRIO MDK questions such as this one. 
    The FlexRIO MDK manual is designed to provide all of the information a hardware designer will need to create a FlexRIO adapter module.  National Instruments is always improving and working on new releases of the FlexRIO MDK.  Please feel free to use the support email address in the FlexRIO MDK manual to send me any feedback you have on the contents of the manual.
    Regards,
    Browning G
    FlexRIO R&D

  • Page Validation - Function Returning Boolean - Check for NULL

    I have 3 Page Validations which all fire on "When Button Pressed" = "Submit".
    <br><br>
    Number 1 is of type "Item specified is NOT NULL" for "P199_BUSINESS_UNIT1".
    <br>
    Number 2 is of type "Item specified is NOT NULL" for "P199_BUSINESS_UNIT2".
    <br>
    Number 3 is of type "Function Returning Boolean" and has the following code:
    <br><br>
    IF :P199_BUSINESS_UNIT1 IS NULL   AND
       :P199_BUSINESS_UNIT2 IS NULL  THEN
        RETURN FALSE ;
    ELSE
        RETURN TRUE  ;
    END IF ;<br>
    When P199_BUSINESS_UNIT1 is NULL and P199_BUSINESS_UNIT2 is NOT NULL, I get the Error from Validation 1. Perfect.
    <br>
    When P199_BUSINESS_UNIT1 is NOT NULL and P199_BUSINESS_UNIT2 is NULL, I get the Error from Validation 2. Perfect.
    <br>
    When P199_BUSINESS_UNIT1 is NOT NULL and P199_BUSINESS_UNIT2 is NOT NULL, I don't get an Error Message. Perfect.
    <br><br>
    When P199_BUSINESS_UNIT1 is NULL and P199_BUSINESS_UNIT2 is NULL, I get Error Message 1 & 2, <strong>but nothing from 3.</strong>
    <br><br>
    If I change the code to:
    <br><br>
    IF :P199_BUSINESS_UNIT1 = '01'   AND
       :P199_BUSINESS_UNIT2 = '01'  THEN
        RETURN FALSE ;
    ELSE
        RETURN TRUE  ;
    END IF ;<br>
    and change both values to '01', I get the appropriate Error Message.
    <br><br>
    What is going on? Is there some reason I can't check for NULL in a Function Returning Boolean?

    Scott,
    <br><br>
    Instead of adding the Validations, I changed my code from:
    <br><br>
    IF :P199_BUSINESS_UNIT1 IS NULL   AND
       :P199_BUSINESS_UNIT2 IS NULL  THEN
        RETURN FALSE ;
    ELSE
        RETURN TRUE  ;
    END IF ;
    <br>to the following and got the desired results:
    <br><br>
    IF  REPLACE(:P199_BUSINESS_UNIT1,<strong>'%null'</strong> || '%',NULL) IS NULL   AND
        REPLACE(:P199_BUSINESS_UNIT2,<strong>'%null'</strong> || '%',NULL) IS NULL  THEN
        RETURN FALSE ;
    ELSE
        RETURN TRUE  ;
    END IF ;<br>
    Note that I changed the word REPLACE to upper case and the second occurrence of the word NULL to upper case to accentuate the fact that the '%null' is case sensitive, using "%NULL' does not work, it has to be "%null' in lower case.
    <br><br>
    <strong>Thanks for your help.</strong>

  • Validation check for Tcode FB10 and FB60 - FICO.

    I have an issue in validation check for Tcode 'FB60' and  'FB10'.
    there are two exits coded for these transactions through transaction 'GGB0'.
    details for the two exits.
    exit 1.
      when posting a vendor invoice, the network status is checked whether it is completed or not - if status is completed error message is raised.
    exit 2.
      when posting vendor invoice - for G/L Account in 60000 - 69999 series network should not be posted. if posted error message is raised.
    when these two exits are entered via a prerequisites in code 'KGB' a code is generated automatically to call these exits- when transaction 'FB10' 'FB60' is executed.
    Issue:
    for  code 'FB10' is executed with network with status completed and with G/LP account in 60000 - 69999 series -
    error message is raised in sequence i.e. exit 1 is raised and then exit 2 is raised.
    but for code 'FB60' if condition for exit 2 is  not satisfied then exit 1 message is raised.
    but it should be in sequence in raising the error message i.e. exit 1 and then exit.
    Even though for both the transaction the auto generated code is similar and even exits are similar - but it is execution in raising the error message is diffrent.
    - Since it is auto generated code i am able to figure out the issue.
    i would appreciate if any one could help me out in this issue.
    thank you,
    with dregs,
    Karthik.

    Hi,
    I have tried what you have suggested. But still validation is not working
    I have done the following validation based on your inputs.
    Prerequisite
    Company Code = '1265' AND Transaction code = 'FB60' AND
    Account Type = 'K' OR
    Transaction code = 'F-43' AND Account Type = 'K' OR
    Transaction code = 'F-48' AND Account Type = 'K'
    Check
    Business Place > '' AND Business Place = Section Code
    Message
    E - Error Message
    Still it is not working.
    Please suggest.
    Best Regards
    Shashikanth.M

  • Validation check for Cash Payments

    Hi Gurus,
    I need to put validation check for cash payment only - not more than Rs. 20000/- & no check for cash receipt.
    Please guide me what is reqd in - PREQUISITE & CHECK.
    Thanks,
    Vikas

    Hi Vikas,
    Try this, its working at my place.
    Prerequsite:
    BKPF-AWTYP = 'CAJO' AND BSEG-WRBTR > '20000.00' AND (
    BSEG-HKONT = 'XXXXXX' AND BSEG-BSCHL = '50' )
    Check:
    NOT SYST-UNAME IN <Set name@>
    @ being set created with Table-SYST and field name- UNAME
    Here the set was created to allow few user to post more than 20000/-
    Regards,
    Kiran

  • I received a phishing email supposedly from my bank and clicked on url - didn't enter any data though.Bank says to get ipad checked for viruses,but I understood ipad has built in security.I've cleared cookies in safari via settings.  Anything else to do?

    I received a phishing email supposedly from my bank and clicked on url - didn't enter any data though.Bank says to get ipad checked for viruses,but I understood ipad has built in security.I've cleared cookies in safari via settings.  Anything else to do?

    I know this has been solved as you reported, but I think you need to check with your e-mail provider. Did you also get this same e-mail on your computer? If you use the same ID for e-mail on computer and ipad, it should have appeared on both. It's very common spam. Check your computer to see if on it, the e-mail is in spam, or, if you deleted it on your ipad, check your recently deleted e-mails.
    You might want to consider changing your password, though people sending spam, don't need it. My e-mail provider had me change my password, not because I was getting spam, but unknown to me, I was sending it!  (You'll still get some spam, though.) It's when you learn that you're unknowingly sending spam...that you must change your password.
    Hope this helps.
    (Ss I was sending this, I just got an e-mail notification from the Nigerian... it got to my e-mail instead of going to spam.)

  • Raw Device Validation Check for Name Failed..

    Hi all,
    I have installed Oracle Clusterware 10.2.0.4 and Oracle database software 10.2.0.4 on Solaris SPARC 10 and i using a NAS storage for the same
    And when i try to create a database using DBCA i got the following error.
    Raw Device Validation Check for Name /u03/oradata/spfile/spfile{SID}.ora failed. The specified file /u01/oradata/spfile/spfile{SID}.ora doesnot exit.Please a existing file.
    Note: i am not using ASM., i am using RAW device for Database
    Any help highly thankful
    -Arun

    Hi
    this is how i have mounted the NAS...
    10.0.0.0:/vol/prodt3_vol16/ora_dbfr_inn1s - /u07/DBFR/INS nfs - yes rw,bg,hard,nointr,rsize=32768,wsize=32768,proto=tcp,noac,forcedirectio,vers=3,suid
    how do i ensure that it is not being used....we should not use ASM its an client requinment ...
    Thanks

  • Regex for url pattern validation

    Hi,
    I am trying to find a regex for Url pattern validation that is not too restrictive.
    Please let me know, if anyone is using a pattern for their applications.
    Thanks
    Mayank Sharma

    are you talking about xml schema restriction?
    <xs:element name="url">
      <xs:simpleType>
       <xs:restriction base="xs:string">
        <xs:pattern value="(https?://)?[-\w.]+(:\d{2,5})?(/([\w/_.]*)?)?" />
       </xs:restriction>
      </xs:simpleType>
    </xs:element>

  • I am on a MAC Application. It has  been rejected by following reason.  This app does not check for the existence of a purchase receipt, which can prevent In-App Purchases from being correctly processed. We recommend implementing receipt validation to reso

    I am on a MAC Application.
    It has  been rejected by following reason.
    This app does not check for the existence of a purchase receipt, which can prevent In-App Purchases from being correctly processed.
    We recommend implementing receipt validation to resolve this issue.
    At a minimum, the app will need to check for the existence of an App Store receipt and exit at launch with a status of 173 if it does not exist.
    Any help ?
    Thanks in Advance.

    I am on a MAC Application.
    It has  been rejected by following reason.
    This app does not check for the existence of a purchase receipt, which can prevent In-App Purchases from being correctly processed.
    We recommend implementing receipt validation to resolve this issue.
    At a minimum, the app will need to check for the existence of an App Store receipt and exit at launch with a status of 173 if it does not exist.
    Any help ?
    Thanks in Advance.

  • Validation Check for business place and section code.

    Hi Gurus
    Please provide me the prequisite check for creating a validation check for business place and section code.
    Regards,
    Vikas Malhotra

    Hii..
    Goto T.Code Ob28 write the following validation.
    Prerequisite
    BKPF-BUKRS = 'XXXX' AND BSEG-KOART = 'K' AND
    BSEG-QSSKZ = 'XX' AND BSEG-BSCHL <> '35' AND
    BSEG-BSCHL <> '25'
    Check
    BSEG-BUPLA = 'XXXX' AND BSEG-SECCO = 'XXXX'
    Message
    Message number ZFI    002
    Regards,
    Aakash

Maybe you are looking for