Exemple #1
0
        /// <summary> Produce a name that contains a file specification including full path.
        /// File names may come in as 'mx.bla : file:/bla.foo.as' or as
        /// 'file://bla.foo.as' or as 'C:\'(?) or as 'basepath;package;filename'
        /// </summary>
        private static String generatePath(NameParser nameParser)
        {
            String name = nameParser.OriginalName;
            String s    = name;

            /* strip off first colon of stuff if package exists */
            int colonAt = name.IndexOf(':');

            if (colonAt > 1 && !name.StartsWith("Actions for"))
            //$NON-NLS-1$
            {
                if (name[colonAt + 1] == ' ')
                {
                    s = name.Substring(colonAt + 2);
                }
            }
            else if (name.IndexOf('.') > -1 && name[0] != '<')
            {
                /* some other type of file name */
                s = nameParser.recombine();
            }
            else
            {
                // no path
                s = "";                 //$NON-NLS-1$
            }
            return(s.Trim());
        }
Exemple #2
0
		/// <summary> Produce a name that contains a file specification including full path.
		/// File names may come in as 'mx.bla : file:/bla.foo.as' or as
		/// 'file://bla.foo.as' or as 'C:\'(?) or as 'basepath;package;filename'
		/// </summary>
		private static String generatePath(NameParser nameParser)
		{
			String name = nameParser.OriginalName;
			String s = name;
			
			/* strip off first colon of stuff if package exists */
			int colonAt = name.IndexOf(':');
			if (colonAt > 1 && !name.StartsWith("Actions for"))
			//$NON-NLS-1$
			{
				if (name[colonAt + 1] == ' ')
					s = name.Substring(colonAt + 2);
			}
			else if (name.IndexOf('.') > - 1 && name[0] != '<')
			{
				/* some other type of file name */
				s = nameParser.recombine();
			}
			else
			{
				// no path
				s = ""; //$NON-NLS-1$
			}
			return s.Trim();
		}