Пример #1
0
        /// <summary>
        /// Dissect Naming URL strings to obtain referenced host, port and
        /// object name.
        /// </summary>
        /// <returns> an object which contains each of the above
        /// components.
        /// </returns>
        /// <exception cref="MalformedURLException"> if given url string is malformed </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private static ParsedNamingURL parseURL(String str) throws java.net.MalformedURLException
        private static ParsedNamingURL ParseURL(String str)
        {
            try
            {
                return(IntParseURL(str));
            }
            catch (URISyntaxException ex)
            {
                /* With RFC 3986 URI handling, 'rmi://:<port>' and
                 * '//:<port>' forms will result in a URI syntax exception
                 * Convert the authority to a localhost:<port> form
                 */
                MalformedURLException mue = new MalformedURLException("invalid URL String: " + str);
                mue.InitCause(ex);
                int indexSchemeEnd      = str.IndexOf(':');
                int indexAuthorityBegin = str.IndexOf("//:");
                if (indexAuthorityBegin < 0)
                {
                    throw mue;
                }
                if ((indexAuthorityBegin == 0) || ((indexSchemeEnd > 0) && (indexAuthorityBegin == indexSchemeEnd + 1)))
                {
                    int    indexHostBegin = indexAuthorityBegin + 2;
                    String newStr         = str.Substring(0, indexHostBegin) + "localhost" + str.Substring(indexHostBegin);
                    try
                    {
                        return(IntParseURL(newStr));
                    }
                    catch (URISyntaxException)
                    {
                        throw mue;
                    }
                    catch (MalformedURLException inte)
                    {
                        throw inte;
                    }
                }
                throw mue;
            }
        }
Пример #2
0
 public void OnMalformedURLException(MalformedURLException e,
                                     Object state)
 {
     Log.Error("Facebook", e.Message);
     e.PrintStackTrace();
 }
Пример #3
0
 public virtual ProcessEngineException invalidDeploymentDescriptorLocation(string bpmPlatformFileLocation, MalformedURLException e)
 {
     throw new ProcessEngineException(exceptionMessage("047", "'{} is not a valid camunda bpm platform configuration resource location.", bpmPlatformFileLocation), e);
 }