idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
23,100 | public String getFullName ( ) { String fullName ; if ( tagLib != null ) { fullName = tagLib . getNameSpaceAndSeparator ( ) + name ; } else { fullName = name ; } return fullName ; } | Gibt den kompletten Namen des Tag zurueck inkl . Name - Space und Trenner . |
23,101 | public TagDependentBodyTransformer getBodyTransformer ( ) throws TagLibException { if ( ! hasTDBTClassDefinition ( ) ) return null ; if ( tdbt != null ) return tdbt ; try { tdbt = ( TagDependentBodyTransformer ) tdbtCD . getClazz ( ) . newInstance ( ) ; } catch ( Throwable t ) { ExceptionUtil . rethrowIfNecessary ( t ) ; throw new TagLibException ( t ) ; } return tdbt ; } | Gibt den TagDependentBodyTransformer dieser Klasse zurueck . Falls kein TagDependentBodyTransformer definiert ist wird null zurueckgegeben . |
23,102 | public void setBodyContent ( String value ) { value = value . toLowerCase ( ) . trim ( ) ; this . hasBody = ! value . equals ( "empty" ) ; this . isBodyReq = ! value . equals ( "free" ) ; this . isTagDependent = value . equals ( "tagdependent" ) ; bodyFree = value . equals ( "free" ) ; } | Setzt die Information was fuer ein BodyContent das Tag haben kann . Diese Methode wird durch die Klasse TagLibFactory verwendet . |
23,103 | public void setTDBTClassDefinition ( String tdbtClass , Identification id , Attributes attr ) { this . tdbtCD = ClassDefinitionImpl . toClassDefinition ( tdbtClass , id , attr ) ; this . tdbt = null ; } | Setzt die implementierende Klassendefinition des TagDependentBodyTransformer . Diese Methode wird durch die Klasse TagLibFactory verwendet . |
23,104 | public void setAttributeEvaluatorClassDefinition ( String className , Identification id , Attributes attr ) { cdAttributeEvaluator = ClassDefinitionImpl . toClassDefinition ( className , id , attr ) ; ; } | Setzt den Namen der Klasse welche einen AttributeEvaluator implementiert . |
23,105 | public Tag getTag ( Factory f , Position start , Position end ) throws TagLibException { if ( StringUtil . isEmpty ( tttCD ) ) return new TagOther ( f , start , end ) ; try { return _getTag ( f , start , end ) ; } catch ( ClassException e ) { throw new TagLibException ( e . getMessage ( ) ) ; } catch ( NoSuchMethodException e ) { throw new TagLibException ( e . getMessage ( ) ) ; } catch ( Throwable e ) { ExceptionUtil . rethrowIfNecessary ( e ) ; throw new TagLibException ( e ) ; } } | return ASM Tag for this tag |
23,106 | public Expression getAttributeUndefinedValue ( Factory factory ) { if ( attrUndefinedValue == null ) return factory . TRUE ( ) ; return factory . createLiteral ( attrUndefinedValue , factory . TRUE ( ) ) ; } | attribute value set if the attribute has no value defined |
23,107 | public PageContextImpl initialize ( HttpServlet servlet , HttpServletRequest req , HttpServletResponse rsp , String errorPageURL , boolean needsSession , int bufferSize , boolean autoFlush , boolean isChild , boolean ignoreScopes ) { parent = null ; requestId = counter ++ ; appListenerType = ApplicationListener . TYPE_NONE ; this . ignoreScopes = ignoreScopes ; ReqRspUtil . setContentType ( rsp , "text/html; charset=" + config . getWebCharset ( ) . name ( ) ) ; this . isChild = isChild ; applicationContext = defaultApplicationContext ; startTime = System . currentTimeMillis ( ) ; thread = Thread . currentThread ( ) ; this . req = new HTTPServletRequestWrap ( req ) ; this . rsp = rsp ; this . servlet = servlet ; if ( config . debugLogOutput ( ) ) { CFMLWriter w = config . getCFMLWriter ( this , req , rsp ) ; w . setAllowCompression ( false ) ; DebugCFMLWriter dcw = new DebugCFMLWriter ( w ) ; bodyContentStack . init ( dcw ) ; debugger . setOutputLog ( dcw ) ; } else { bodyContentStack . init ( config . getCFMLWriter ( this , req , rsp ) ) ; } writer = bodyContentStack . getWriter ( ) ; forceWriter = writer ; server = ScopeContext . getServerScope ( this , ignoreScopes ) ; if ( hasFamily ) { variablesRoot = new VariablesImpl ( ) ; variables = variablesRoot ; request = new RequestImpl ( ) ; _url = new URLImpl ( ) ; _form = new FormImpl ( ) ; urlForm = new UrlFormImpl ( _form , _url ) ; undefined = new UndefinedImpl ( this , getScopeCascadingType ( ) ) ; hasFamily = false ; } else if ( variables == null ) { variablesRoot = new VariablesImpl ( ) ; variables = variablesRoot ; } request . initialize ( this ) ; if ( config . mergeFormAndURL ( ) ) { url = urlForm ; form = urlForm ; } else { url = _url ; form = _form ; } psq = config . getPSQL ( ) ; fdEnabled = ! config . allowRequestTimeout ( ) ; if ( config . getExecutionLogEnabled ( ) ) this . execLog = config . getExecutionLogFactory ( ) . getInstance ( this ) ; if ( debugger != null ) debugger . init ( config ) ; undefined . initialize ( this ) ; timeoutStacktrace = null ; return this ; } | initialize a existing page context |
23,108 | public void writeEncodeFor ( String value , String encodeType ) throws IOException , PageException { write ( ESAPIUtil . esapiEncode ( this , encodeType , value ) ) ; } | FUTURE add both method to interface |
23,109 | public void doInclude ( String realPath , boolean runOnce , Object cachedWithin ) throws PageException { if ( cachedWithin == null ) cachedWithin = getCachedWithin ( ConfigWeb . CACHEDWITHIN_INCLUDE ) ; _doInclude ( getRelativePageSources ( realPath ) , runOnce , cachedWithin ) ; } | used by the transformer |
23,110 | public void _doInclude ( PageSource [ ] sources , boolean runOnce , Object cachedWithin ) throws PageException { if ( cachedWithin == null ) { _doInclude ( sources , runOnce ) ; return ; } if ( runOnce ) { Page currentPage = PageSourceImpl . loadPage ( this , sources ) ; if ( runOnce && includeOnce . contains ( currentPage . getPageSource ( ) ) ) return ; } String cacheId = CacheHandlerCollectionImpl . createId ( sources ) ; CacheHandler cacheHandler = config . getCacheHandlerCollection ( Config . CACHE_TYPE_INCLUDE , null ) . getInstanceMatchingObject ( cachedWithin , null ) ; if ( cacheHandler instanceof CacheHandlerPro ) { CacheItem cacheItem = ( ( CacheHandlerPro ) cacheHandler ) . get ( this , cacheId , cachedWithin ) ; if ( cacheItem instanceof IncludeCacheItem ) { try { write ( ( ( IncludeCacheItem ) cacheItem ) . getOutput ( ) ) ; return ; } catch ( IOException e ) { throw Caster . toPageException ( e ) ; } } } else if ( cacheHandler != null ) { CacheItem cacheItem = cacheHandler . get ( this , cacheId ) ; if ( cacheItem instanceof IncludeCacheItem ) { try { write ( ( ( IncludeCacheItem ) cacheItem ) . getOutput ( ) ) ; return ; } catch ( IOException e ) { throw Caster . toPageException ( e ) ; } } } long start = System . nanoTime ( ) ; BodyContent bc = pushBody ( ) ; try { _doInclude ( sources , runOnce ) ; String out = bc . getString ( ) ; if ( cacheHandler != null ) { CacheItem cacheItem = new IncludeCacheItem ( out , ArrayUtil . isEmpty ( sources ) ? null : sources [ 0 ] , System . nanoTime ( ) - start ) ; cacheHandler . set ( this , cacheId , cachedWithin , cacheItem ) ; return ; } } finally { BodyContentUtil . flushAndPop ( this , bc ) ; } } | calling this method and in this case it should not be used |
23,111 | public void subparam ( String type , String name , final Object value , double min , double max , String strPattern , int maxLength , final boolean isNew ) throws PageException { if ( type == null ) type = "any" ; else type = type . trim ( ) . toLowerCase ( ) ; if ( ! "any" . equals ( type ) ) { if ( "range" . equals ( type ) ) { boolean hasMin = Decision . isValid ( min ) ; boolean hasMax = Decision . isValid ( max ) ; double number = Caster . toDoubleValue ( value ) ; if ( ! hasMin && ! hasMax ) throw new ExpressionException ( "you need to define one of the following attributes [min,max], when type is set to [range]" ) ; if ( hasMin && number < min ) throw new ExpressionException ( "The number [" + Caster . toString ( number ) + "] is to small, the number must be at least [" + Caster . toString ( min ) + "]" ) ; if ( hasMax && number > max ) throw new ExpressionException ( "The number [" + Caster . toString ( number ) + "] is to big, the number cannot be bigger than [" + Caster . toString ( max ) + "]" ) ; setVariable ( name , Caster . toDouble ( number ) ) ; } else if ( "regex" . equals ( type ) || "regular_expression" . equals ( type ) ) { String str = Caster . toString ( value ) ; if ( strPattern == null ) throw new ExpressionException ( "Missing attribute [pattern]" ) ; if ( ! Perl5Util . matches ( strPattern , str ) ) throw new ExpressionException ( "The value [" + str + "] doesn't match the provided pattern [" + strPattern + "]" ) ; setVariable ( name , str ) ; } else if ( type . equals ( "int" ) || type . equals ( "integer" ) ) { if ( ! Decision . isInteger ( value ) ) throw new ExpressionException ( "The value [" + value + "] is not a valid integer" ) ; setVariable ( name , value ) ; } else { if ( ! Decision . isCastableTo ( type , value , true , true , maxLength ) ) { if ( maxLength > - 1 && ( "email" . equalsIgnoreCase ( type ) || "url" . equalsIgnoreCase ( type ) || "string" . equalsIgnoreCase ( type ) ) ) { StringBuilder msg = new StringBuilder ( CasterException . createMessage ( value , type ) ) ; msg . append ( " with a maximum length of " + maxLength + " characters" ) ; throw new CasterException ( msg . toString ( ) ) ; } throw new CasterException ( value , type ) ; } setVariable ( name , value ) ; } } else if ( isNew ) setVariable ( name , value ) ; } | used by generated code FUTURE add to interface |
23,112 | private void initIdAndToken ( ) { boolean setCookie = true ; Object oCfid = urlScope ( ) . get ( KeyConstants . _cfid , null ) ; Object oCftoken = urlScope ( ) . get ( KeyConstants . _cftoken , null ) ; if ( oCfid != null ) { if ( Decision . isGUIdSimple ( oCfid ) ) { if ( ! scopeContext . hasExistingCFID ( this , Caster . toString ( oCfid , null ) ) ) { oCfid = null ; oCftoken = null ; } } else { oCfid = null ; oCftoken = null ; } } if ( oCfid == null ) { setCookie = false ; oCfid = cookieScope ( ) . get ( KeyConstants . _cfid , null ) ; oCftoken = cookieScope ( ) . get ( KeyConstants . _cftoken , null ) ; } if ( oCfid != null ) { if ( ! Decision . isGUIdSimple ( oCfid ) ) { oCfid = null ; oCftoken = null ; Charset charset = getWebCharset ( ) ; javax . servlet . http . Cookie [ ] cookies = getHttpServletRequest ( ) . getCookies ( ) ; String name , value ; if ( cookies != null ) { for ( int i = 0 ; i < cookies . length ; i ++ ) { name = ReqRspUtil . decode ( cookies [ i ] . getName ( ) , charset . name ( ) , false ) ; if ( "cfid" . equalsIgnoreCase ( name ) ) { value = ReqRspUtil . decode ( cookies [ i ] . getValue ( ) , charset . name ( ) , false ) ; if ( Decision . isGUIdSimple ( value ) ) oCfid = value ; ReqRspUtil . removeCookie ( getHttpServletResponse ( ) , name ) ; } else if ( "cftoken" . equalsIgnoreCase ( name ) ) { value = ReqRspUtil . decode ( cookies [ i ] . getValue ( ) , charset . name ( ) , false ) ; if ( isValidCfToken ( value ) ) oCftoken = value ; ReqRspUtil . removeCookie ( getHttpServletResponse ( ) , name ) ; } } } if ( oCfid != null ) { setCookie = true ; if ( oCftoken == null ) oCftoken = "0" ; } } } if ( oCfid == null || oCftoken == null ) { setCookie = true ; cfid = ScopeContext . getNewCFId ( ) ; cftoken = ScopeContext . getNewCFToken ( ) ; } else { cfid = Caster . toString ( oCfid , null ) ; cftoken = Caster . toString ( oCftoken , "0" ) ; } if ( setCookie && applicationContext . isSetClientCookies ( ) ) setClientCookies ( ) ; } | initialize the cfid and the cftoken |
23,113 | private static boolean _full ( PageContext pc ) { pc = ThreadLocalPageContext . get ( pc ) ; if ( pc == null ) return false ; return pc . getCurrentTemplateDialect ( ) != CFMLEngine . DIALECT_CFML || ( ( PageContextImpl ) pc ) . getFullNullSupport ( ) ; } | protected static boolean simpleMode ; |
23,114 | public static void register ( PageContext pc ) { if ( pc == null ) return ; Thread t = Thread . currentThread ( ) ; t . setContextClassLoader ( ( ( ConfigImpl ) pc . getConfig ( ) ) . getClassLoaderEnv ( ) ) ; ( ( PageContextImpl ) pc ) . setThread ( t ) ; pcThreadLocal . set ( pc ) ; } | register a pagecontext for he current thread |
23,115 | public static Reference getInstance ( Object o , String key ) { if ( o instanceof Reference ) { return new ReferenceReference ( ( Reference ) o , key ) ; } Collection coll = Caster . toCollection ( o , null ) ; if ( coll != null ) return new VariableReference ( coll , key ) ; return new NativeReference ( o , key ) ; } | returns a Reference Instance |
23,116 | private Map < String , Scope > getSubMap ( Map < String , Map < String , Scope > > parent , String key ) { Map < String , Scope > context = parent . get ( key ) ; if ( context != null ) return context ; context = MapFactory . < String , Scope > getConcurrentMap ( ) ; parent . put ( key , context ) ; return context ; } | return a map matching key from given map |
23,117 | public static Server getServerScope ( PageContext pc , boolean jsr223 ) { if ( server == null ) { server = new ServerImpl ( pc , jsr223 ) ; } return server ; } | return the server Scope for this context |
23,118 | public static Cluster getClusterScope ( Config config , boolean create ) throws PageException { if ( cluster == null && create ) { cluster = ( ( ConfigImpl ) config ) . createClusterScope ( ) ; } return cluster ; } | Returns the current Cluster Scope if there is no current Cluster Scope and create is true returns a new Cluster Scope . If create is false and the request has no valid Cluster Scope this method returns null . |
23,119 | public int getAppContextSessionCount ( PageContext pc ) { ApplicationContext appContext = pc . getApplicationContext ( ) ; if ( pc . getSessionType ( ) == Config . SESSION_TYPE_JEE ) return 0 ; Map < String , Scope > context = getSubMap ( cfSessionContexts , appContext . getName ( ) ) ; return getCount ( context ) ; } | return the session count of this application context |
23,120 | public long getScopesSize ( int scope ) throws ExpressionException { if ( scope == Scope . SCOPE_APPLICATION ) return SizeOf . size ( applicationContexts ) ; if ( scope == Scope . SCOPE_CLUSTER ) return SizeOf . size ( cluster ) ; if ( scope == Scope . SCOPE_SERVER ) return SizeOf . size ( server ) ; if ( scope == Scope . SCOPE_SESSION ) return SizeOf . size ( this . cfSessionContexts ) ; if ( scope == Scope . SCOPE_CLIENT ) return SizeOf . size ( this . cfClientContexts ) ; throw new ExpressionException ( "can only return information of scope that are not request dependent" ) ; } | return the size in bytes of all session contexts |
23,121 | private Session getJSessionScope ( PageContext pc , RefBoolean isNew ) throws PageException { HttpSession httpSession = pc . getSession ( ) ; ApplicationContext appContext = pc . getApplicationContext ( ) ; Object session = null ; int s = ( int ) appContext . getSessionTimeout ( ) . getSeconds ( ) ; if ( maxSessionTimeout < s ) maxSessionTimeout = s ; if ( httpSession != null ) { httpSession . setMaxInactiveInterval ( maxSessionTimeout + 60 ) ; session = httpSession . getAttribute ( appContext . getName ( ) ) ; } else { Map < String , Scope > context = getSubMap ( cfSessionContexts , appContext . getName ( ) ) ; session = context . get ( pc . getCFID ( ) ) ; } JSession jSession = null ; if ( session instanceof JSession ) { jSession = ( JSession ) session ; try { if ( jSession . isExpired ( ) ) { jSession . touch ( ) ; } info ( getLog ( ) , "use existing JSession for " + appContext . getName ( ) + "/" + pc . getCFID ( ) ) ; } catch ( ClassCastException cce ) { error ( getLog ( ) , cce ) ; if ( httpSession == null ) return getCFSessionScope ( pc , isNew ) ; jSession = new JSession ( ) ; httpSession . setAttribute ( appContext . getName ( ) , jSession ) ; isNew . setValue ( true ) ; } } else { if ( httpSession == null ) return getCFSessionScope ( pc , isNew ) ; info ( getLog ( ) , "create new JSession for " + appContext . getName ( ) + "/" + pc . getCFID ( ) ) ; jSession = new JSession ( ) ; httpSession . setAttribute ( appContext . getName ( ) , jSession ) ; isNew . setValue ( true ) ; Map < String , Scope > context = getSubMap ( cfSessionContexts , appContext . getName ( ) ) ; context . put ( pc . getCFID ( ) , jSession ) ; } jSession . touchBeforeRequest ( pc ) ; return jSession ; } | return j session scope |
23,122 | public void clearUnused ( ) { Log log = getLog ( ) ; try { if ( session == null ) session = new StorageScopeEngine ( factory , log , new StorageScopeCleaner [ ] { new FileStorageScopeCleaner ( Scope . SCOPE_SESSION , null ) , new DatasourceStorageScopeCleaner ( Scope . SCOPE_SESSION , null ) } ) ; if ( client == null ) client = new StorageScopeEngine ( factory , log , new StorageScopeCleaner [ ] { new FileStorageScopeCleaner ( Scope . SCOPE_CLIENT , null ) , new DatasourceStorageScopeCleaner ( Scope . SCOPE_CLIENT , null ) } ) ; storeUnusedStorageScope ( factory , Scope . SCOPE_CLIENT ) ; storeUnusedStorageScope ( factory , Scope . SCOPE_SESSION ) ; clearUnusedMemoryScope ( factory , Scope . SCOPE_CLIENT ) ; clearUnusedMemoryScope ( factory , Scope . SCOPE_SESSION ) ; session . clean ( ) ; client . clean ( ) ; clearUnusedApplications ( factory ) ; } catch ( Exception t ) { error ( t ) ; } } | remove all unused scope objects |
23,123 | public void clear ( ) { try { Scope scope ; Iterator < Entry < String , Map < String , Scope > > > sit = cfSessionContexts . entrySet ( ) . iterator ( ) ; Entry < String , Map < String , Scope > > sentry ; Map < String , Scope > context ; Iterator < Entry < String , Scope > > itt ; Entry < String , Scope > e ; PageContext pc = ThreadLocalPageContext . get ( ) ; while ( sit . hasNext ( ) ) { sentry = sit . next ( ) ; context = sentry . getValue ( ) ; itt = context . entrySet ( ) . iterator ( ) ; while ( itt . hasNext ( ) ) { e = itt . next ( ) ; scope = e . getValue ( ) ; scope . release ( pc ) ; } } cfSessionContexts . clear ( ) ; Iterator < Entry < String , Application > > ait = applicationContexts . entrySet ( ) . iterator ( ) ; Entry < String , Application > aentry ; while ( ait . hasNext ( ) ) { aentry = ait . next ( ) ; scope = aentry . getValue ( ) ; scope . release ( pc ) ; } applicationContexts . clear ( ) ; if ( server != null ) { server . release ( pc ) ; server = null ; } } catch ( Throwable t ) { ExceptionUtil . rethrowIfNecessary ( t ) ; } } | remove all scope objects |
23,124 | public boolean equalTo ( CFMLEngine other , final boolean checkReferenceEqualityOnly ) { while ( other instanceof CFMLEngineWrapper ) other = ( ( CFMLEngineWrapper ) other ) . engine ; if ( checkReferenceEqualityOnly ) return engine == other ; return engine . equals ( other ) ; } | this interface is new to this class and not officially part of Lucee 3 . x do not use outside the loader |
23,125 | public void cleanUp ( ) { int nI ; for ( nI = 0 ; nI < PBOX_ENTRIES ; nI ++ ) m_pbox [ nI ] = 0 ; for ( nI = 0 ; nI < SBOX_ENTRIES ; nI ++ ) m_sbox1 [ nI ] = m_sbox2 [ nI ] = m_sbox3 [ nI ] = m_sbox4 [ nI ] = 0 ; } | to clear data in the boxes before an instance is freed |
23,126 | private static String toVariableName ( String str ) { StringBuffer rtn = new StringBuffer ( ) ; char [ ] chars = str . toCharArray ( ) ; long changes = 0 ; boolean doCorrect = true ; for ( int i = 0 ; i < chars . length ; i ++ ) { char c = chars [ i ] ; if ( i == 0 && ( c >= '0' && c <= '9' ) ) rtn . append ( "_" + c ) ; else if ( ( c >= 'a' && c <= 'z' ) || ( c >= 'A' && c <= 'Z' ) || ( c >= '0' && c <= '9' ) || c == '_' || c == '$' ) rtn . append ( c ) ; else { doCorrect = false ; rtn . append ( '_' ) ; changes += ( c * ( i + 1 ) ) ; } } if ( changes > 0 ) rtn . append ( changes ) ; if ( doCorrect ) return correctReservedWord ( rtn . toString ( ) ) ; return rtn . toString ( ) ; } | translate a string to a valid variable string |
23,127 | public static String toClassName ( String str ) { StringBuffer javaName = new StringBuffer ( ) ; String [ ] arr = lucee . runtime . type . util . ListUtil . listToStringArray ( str , '/' ) ; for ( int i = 0 ; i < arr . length ; i ++ ) { if ( i == ( arr . length - 1 ) ) arr [ i ] = replaceLast ( arr [ i ] , '.' , '$' ) ; if ( i != 0 ) javaName . append ( '.' ) ; javaName . append ( toVariableName ( arr [ i ] ) ) ; } return javaName . toString ( ) . toLowerCase ( ) ; } | creates a classbane from give source path |
23,128 | public void setType ( String type ) { property . setType ( type ) ; setDynamicAttribute ( null , KeyConstants . _type , type ) ; } | set the value type A string ; a property type name ; data type . |
23,129 | public void setName ( String name ) { property . setName ( name ) ; setDynamicAttribute ( null , KeyConstants . _name , name ) ; } | set the value name A string ; a property name . Must be a static value . |
23,130 | public static void deploy ( Resource dir , boolean doNew ) { String path = "/resource/component/" + ( Constants . DEFAULT_PACKAGE . replace ( '.' , '/' ) ) + "/" ; deploy ( dir , path , doNew , "Base" ) ; deploy ( dir , path , doNew , "Feed" ) ; deploy ( dir , path , doNew , "Ftp" ) ; deploy ( dir , path , doNew , "Http" ) ; deploy ( dir , path , doNew , "Mail" ) ; deploy ( dir , path , doNew , "Query" ) ; deploy ( dir , path , doNew , "Result" ) ; deploy ( dir , path , doNew , "Administrator" ) ; { Resource ormDir = dir . getRealResource ( "orm" ) ; String ormPath = path + "orm/" ; if ( ! ormDir . exists ( ) ) ormDir . mkdirs ( ) ; deploy ( ormDir , ormPath , doNew , "IEventHandler" ) ; deploy ( ormDir , ormPath , doNew , "INamingStrategy" ) ; } { Resource testDir = dir . getRealResource ( "test" ) ; String testPath = path + "test/" ; if ( ! testDir . exists ( ) ) testDir . mkdirs ( ) ; deploy ( testDir , testPath , doNew , "LuceeTestSuite" ) ; deploy ( testDir , testPath , doNew , "LuceeTestSuiteRunner" ) ; deploy ( testDir , testPath , doNew , "LuceeTestCase" ) ; } } | this method deploy all components for org . lucee . cfml |
23,131 | public static final File URLToFile ( URL url ) throws MalformedURLException { if ( ! "file" . equals ( url . getProtocol ( ) ) ) throw new MalformedURLException ( "URL protocol must be 'file'." ) ; return new File ( URIToFilename ( url . getFile ( ) ) ) ; } | translate a URL to a File Object |
23,132 | public static final String URIToFilename ( String str ) { if ( str . length ( ) >= 3 ) { if ( str . charAt ( 0 ) == '/' && str . charAt ( 2 ) == ':' ) { char ch1 = Character . toUpperCase ( str . charAt ( 1 ) ) ; if ( ch1 >= 'A' && ch1 <= 'Z' ) str = str . substring ( 1 ) ; } } str = str . replace ( '/' , java . io . File . separatorChar ) ; return str ; } | Fixes a platform dependent filename to standard URI form . |
23,133 | private void connect ( ) throws IOException { client = AFTPClient . getInstance ( conn . secure ( ) , address , conn . getPort ( ) , conn . getUsername ( ) , conn . getPassword ( ) , conn . getFingerprint ( ) , conn . getStopOnError ( ) ) ; if ( client instanceof SFTPClientImpl && conn . getKey ( ) != null ) { ( ( SFTPClientImpl ) client ) . setSshKey ( conn . getKey ( ) , conn . getPassphrase ( ) ) ; } setConnectionSettings ( client , conn ) ; if ( conn . getTransferMode ( ) == FTPConstant . TRANSFER_MODE_ASCCI ) getClient ( ) . setFileType ( FTP . ASCII_FILE_TYPE ) ; else if ( conn . getTransferMode ( ) == FTPConstant . TRANSFER_MODE_BINARY ) getClient ( ) . setFileType ( FTP . BINARY_FILE_TYPE ) ; try { Proxy . start ( conn . getProxyServer ( ) , conn . getProxyPort ( ) , conn . getProxyUser ( ) , conn . getProxyPassword ( ) ) ; client . connect ( ) ; } finally { Proxy . end ( ) ; } } | connects the client |
23,134 | public static Session getInstance ( PageContext pc , RefBoolean isNew , Log log ) { isNew . setValue ( true ) ; return new SessionMemory ( pc , log ) ; } | load a new instance of the class |
23,135 | public static String [ ] toRole ( Object oRoles ) throws PageException { if ( oRoles instanceof String ) { oRoles = ListUtil . listToArrayRemoveEmpty ( oRoles . toString ( ) , "," ) ; } if ( oRoles instanceof Array ) { Array arrRoles = ( Array ) oRoles ; String [ ] roles = new String [ arrRoles . size ( ) ] ; for ( int i = 0 ; i < roles . length ; i ++ ) { roles [ i ] = Caster . toString ( arrRoles . get ( i + 1 , "" ) ) ; } return roles ; } throw new ApplicationException ( "invalid roles definition for tag loginuser" ) ; } | convert a Object to a String Array of Roles |
23,136 | public static Credential decode ( Object encoded , Resource rolesDir ) throws PageException { String dec ; try { dec = Base64Coder . decodeToString ( Caster . toString ( encoded ) , "UTF-8" ) ; } catch ( Exception e ) { throw Caster . toPageException ( e ) ; } Array arr = ListUtil . listToArray ( dec , "" + ONE ) ; int len = arr . size ( ) ; if ( len == 3 ) { String str = Caster . toString ( arr . get ( 3 , "" ) ) ; if ( str . startsWith ( "md5:" ) ) { if ( ! rolesDir . exists ( ) ) rolesDir . mkdirs ( ) ; str = str . substring ( 4 ) ; Resource md5 = rolesDir . getRealResource ( str ) ; try { str = IOUtil . toString ( md5 , "utf-8" ) ; } catch ( IOException e ) { str = "" ; } } return new CredentialImpl ( Caster . toString ( arr . get ( 1 , "" ) ) , Caster . toString ( arr . get ( 2 , "" ) ) , str , rolesDir ) ; } if ( len == 2 ) return new CredentialImpl ( Caster . toString ( arr . get ( 1 , "" ) ) , Caster . toString ( arr . get ( 2 , "" ) ) , rolesDir ) ; if ( len == 1 ) return new CredentialImpl ( Caster . toString ( arr . get ( 1 , "" ) ) , rolesDir ) ; return null ; } | decode the Credential form a Base64 String value |
23,137 | public static String decodeToString ( String encoded , String charset ) throws CoderException , UnsupportedEncodingException { byte [ ] dec = decode ( Caster . toString ( encoded , null ) ) ; return new String ( dec , charset ) ; } | decodes a Base64 String to a Plain String |
23,138 | public static String encodeFromString ( String plain , String charset ) throws CoderException , UnsupportedEncodingException { return encode ( plain . getBytes ( charset ) ) ; } | encodes a String to Base64 String |
23,139 | public static Object duplicate ( Object object , boolean deepCopy ) { if ( object == null ) return null ; if ( object instanceof Number ) return object ; if ( object instanceof String ) return object ; if ( object instanceof Date ) return ( ( Date ) object ) . clone ( ) ; if ( object instanceof Boolean ) return object ; RefBoolean before = new RefBooleanImpl ( ) ; try { Object copy = ThreadLocalDuplication . get ( object , before ) ; if ( copy != null ) { return copy ; } if ( object instanceof Collection ) return ( ( Collection ) object ) . duplicate ( deepCopy ) ; if ( object instanceof Duplicable ) return ( ( Duplicable ) object ) . duplicate ( deepCopy ) ; if ( object instanceof UDF ) return ( ( UDF ) object ) . duplicate ( ) ; if ( object instanceof List ) return duplicateList ( ( List ) object , deepCopy ) ; if ( object instanceof Map ) return duplicateMap ( ( Map ) object , deepCopy ) ; if ( object instanceof Serializable ) { try { String ser = JavaConverter . serialize ( ( Serializable ) object ) ; return JavaConverter . deserialize ( ser ) ; } catch ( Throwable t ) { ExceptionUtil . rethrowIfNecessary ( t ) ; } } } finally { if ( ! before . toBooleanValue ( ) ) ThreadLocalDuplication . reset ( ) ; } return object ; } | reference type value duplication |
23,140 | public static Map duplicateMap ( Map map , boolean doKeysLower , boolean deepCopy ) throws PageException { if ( doKeysLower ) { Map newMap ; try { newMap = ( Map ) ClassUtil . loadInstance ( map . getClass ( ) ) ; } catch ( ClassException e ) { newMap = new HashMap ( ) ; } boolean inside = ThreadLocalDuplication . set ( map , newMap ) ; try { Iterator it = map . keySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { Object key = it . next ( ) ; if ( deepCopy ) newMap . put ( StringUtil . toLowerCase ( Caster . toString ( key ) ) , duplicate ( map . get ( key ) , deepCopy ) ) ; else newMap . put ( StringUtil . toLowerCase ( Caster . toString ( key ) ) , map . get ( key ) ) ; } } finally { if ( ! inside ) ThreadLocalDuplication . reset ( ) ; } return newMap ; } return duplicateMap ( map , deepCopy ) ; } | duplicate a map |
23,141 | public void setType ( String type ) throws ExpressionException { type = type . toLowerCase ( ) . trim ( ) ; if ( type . equals ( "exception" ) ) { errorPage . setType ( ErrorPage . TYPE_EXCEPTION ) ; } else if ( type . equals ( "request" ) ) { errorPage . setType ( ErrorPage . TYPE_REQUEST ) ; } else throw new ExpressionException ( "invalid type [" + type + "] for tag error, use one of the following types [exception,request]" ) ; } | set the value type The type of error that the custom error page handles . |
23,142 | public void setTemplate ( String template ) throws MissingIncludeException { PageSource ps = pageContext . getCurrentPageSource ( ) . getRealPage ( template ) ; if ( ! ps . exists ( ) ) throw new MissingIncludeException ( ps ) ; errorPage . setTemplate ( ps ) ; } | set the value template The relative path to the custom error page . |
23,143 | public OutputStream getOutputStream ( ) throws IOException { if ( ! _file . isWriteable ( ) ) { throw new IOException ( "Cannot write" ) ; } return IOUtil . toBufferedOutputStream ( _file . getOutputStream ( ) ) ; } | Get output stream . |
23,144 | public final void writeOut ( Context c ) throws TransformerException { BytecodeContext bc = ( BytecodeContext ) c ; ExpressionUtil . visitLine ( bc , start ) ; _writeOut ( bc ) ; ExpressionUtil . visitLine ( bc , end ) ; } | write out the statement to adapter |
23,145 | public boolean forwardIfCurrent ( String first , char second ) { int start = pos ; if ( ! forwardIfCurrent ( first ) ) return false ; removeSpace ( ) ; boolean rtn = forwardIfCurrent ( second ) ; if ( ! rtn ) pos = start ; return rtn ; } | Gibt zurueck ob first den folgenden Zeichen entspricht gefolgt von Leerzeichen und second wenn ja wird der Zeiger um die Laenge der uebereinstimmung nach vorne gestellt . |
23,146 | public boolean forwardIfCurrent ( short before , String val , short after ) { int start = pos ; if ( before == AT_LEAST_ONE_SPACE ) { if ( ! removeSpace ( ) ) return false ; } else removeSpace ( ) ; if ( ! forwardIfCurrent ( val ) ) { setPos ( start ) ; return false ; } if ( after == AT_LEAST_ONE_SPACE ) { if ( ! removeSpace ( ) ) { setPos ( start ) ; return false ; } } else removeSpace ( ) ; return true ; } | Gibt zurueck ob ein Wert folgt und vor und hinterher Leerzeichen folgen . |
23,147 | public SourceCode subCFMLString ( int start , int count ) { return new SourceCode ( String . valueOf ( text , start , count ) , writeLog , dialect ) ; } | return a subset of the current SourceCode |
23,148 | public int getLine ( int pos ) { for ( int i = 0 ; i < lines . length ; i ++ ) { if ( pos <= lines [ i ] . intValue ( ) ) return i + 1 ; } return lines . length ; } | Gibt zurueck in welcher Zeile die angegebene Position ist . |
23,149 | public int getColumn ( int pos ) { int line = getLine ( pos ) - 1 ; if ( line == 0 ) return pos + 1 ; return pos - lines [ line - 1 ] . intValue ( ) ; } | Gibt die Stelle in der Zeile auf die pos zeigt zurueck . |
23,150 | public String getLineAsString ( int line ) { int index = line - 1 ; if ( lines . length <= index ) return null ; int max = lines [ index ] . intValue ( ) ; int min = 0 ; if ( index != 0 ) min = lines [ index - 1 ] . intValue ( ) + 1 ; if ( min < max && max - 1 < lcText . length ) return this . substring ( min , max - min ) ; return "" ; } | Gibt die angegebene Zeile als String zurueck . |
23,151 | public int indexOfNext ( char c ) { for ( int i = pos ; i < lcText . length ; i ++ ) { if ( lcText [ i ] == c ) return i ; } return - 1 ; } | Gibt zurueck ausgehend von der aktuellen Position wann das naechste Zeichen folgt das gleich ist wie die Eingabe falls keines folgt wird - 1 zurueck gegeben . Gross - und Kleinschreibung der Zeichen werden igoriert . |
23,152 | public String lastWord ( ) { int size = 1 ; while ( pos - size > 0 && lcText [ pos - size ] == ' ' ) { size ++ ; } while ( pos - size > 0 && lcText [ pos - size ] != ' ' && lcText [ pos - size ] != ';' ) { size ++ ; } return this . substring ( ( pos - size + 1 ) , ( pos - 1 ) ) ; } | Gibt das letzte Wort das sich vor dem aktuellen Zeigerstand befindet zurueck falls keines existiert wird null zurueck gegeben . |
23,153 | protected void closeFile ( ) { if ( this . qw != null ) { try { this . qw . close ( ) ; } catch ( java . io . IOException e ) { LogLog . error ( "Could not close " + qw , e ) ; } } } | Closes the previously opened file . |
23,154 | private static void removeTable ( Connection conn , String name ) throws SQLException { name = name . replace ( '.' , '_' ) ; Statement stat = conn . createStatement ( ) ; stat . execute ( "DROP TABLE " + name ) ; DBUtil . commitEL ( conn ) ; } | remove a table from the memory database |
23,155 | private static void removeAll ( Connection conn , ArrayList < String > usedTables ) { int len = usedTables . size ( ) ; for ( int i = 0 ; i < len ; i ++ ) { String tableName = usedTables . get ( i ) . toString ( ) ; try { removeTable ( conn , tableName ) ; } catch ( Throwable t ) { ExceptionUtil . rethrowIfNecessary ( t ) ; } } } | remove all table inside the memory database |
23,156 | public Query execute ( PageContext pc , SQL sql , int maxrows , int fetchsize , TimeSpan timeout ) throws PageException { Stopwatch stopwatch = new Stopwatch ( Stopwatch . UNIT_NANO ) ; stopwatch . start ( ) ; String prettySQL = null ; Selects selects = null ; try { SelectParser parser = new SelectParser ( ) ; selects = parser . parse ( sql . getSQLString ( ) ) ; Query q = qoq . execute ( pc , sql , selects , maxrows ) ; q . setExecutionTime ( stopwatch . time ( ) ) ; return q ; } catch ( SQLParserException spe ) { prettySQL = SQLPrettyfier . prettyfie ( sql . getSQLString ( ) ) ; try { Query query = executer . execute ( pc , sql , prettySQL , maxrows ) ; query . setExecutionTime ( stopwatch . time ( ) ) ; return query ; } catch ( PageException ex ) { } } catch ( PageException e ) { } try { boolean isUnion = false ; Set < String > tables = null ; if ( selects != null ) { HSQLUtil2 hsql2 = new HSQLUtil2 ( selects ) ; isUnion = hsql2 . isUnion ( ) ; tables = hsql2 . getInvokedTables ( ) ; } else { if ( prettySQL == null ) prettySQL = SQLPrettyfier . prettyfie ( sql . getSQLString ( ) ) ; HSQLUtil hsql = new HSQLUtil ( prettySQL ) ; tables = hsql . getInvokedTables ( ) ; isUnion = hsql . isUnion ( ) ; } String strSQL = StringUtil . replace ( sql . getSQLString ( ) , "[" , "" , false ) ; strSQL = StringUtil . replace ( strSQL , "]" , "" , false ) ; sql . setSQLString ( strSQL ) ; return _execute ( pc , sql , maxrows , fetchsize , timeout , stopwatch , tables , isUnion ) ; } catch ( ParseException e ) { throw new DatabaseException ( e . getMessage ( ) , null , sql , null ) ; } } | executes a query on the queries inside the cld fusion enviroment |
23,157 | final Entry < K , V > getEntry ( Object key ) { int hash = ( key == null ) ? 0 : hash ( key ) ; for ( Entry < K , V > e = table [ indexFor ( hash , table . length ) ] ; e != null ; e = e . next ) { if ( e . hash == hash && ( ( e . key ) == key || ( key != null && key . equals ( e . key ) ) ) ) return e ; } return null ; } | Returns the entry associated with the specified key in the HashMap . Returns null if the HashMap contains no mapping for the key . |
23,158 | private V putForNullKey ( V value ) { for ( Entry < K , V > e = table [ 0 ] ; e != null ; e = e . next ) { if ( e . key == null ) { V oldValue = e . value ; e . value = value ; e . recordAccess ( this ) ; return oldValue ; } } modCount ++ ; addEntry ( 0 , null , value , 0 ) ; return null ; } | Offloaded version of put for null keys |
23,159 | public static String getFolderName ( String name , String cfid , boolean addExtension ) { if ( addExtension ) return getFolderName ( name , cfid , false ) + ".scpt" ; if ( ! StringUtil . isEmpty ( name ) ) name = encode ( name ) ; else name = "__empty__" ; return name + "/" + cfid . substring ( 0 , 2 ) + "/" + cfid . substring ( 2 ) ; } | return a folder name that match given input |
23,160 | public static Clob toClob ( Object value ) throws PageException { if ( value instanceof Clob ) return ( Clob ) value ; else if ( value instanceof char [ ] ) return toClob ( new String ( ( char [ ] ) value ) ) ; else if ( value instanceof Reader ) { StringWriter sw = new StringWriter ( ) ; try { IOUtil . copy ( ( Reader ) value , sw , false , true ) ; } catch ( IOException e ) { throw ExpressionException . newInstance ( e ) ; } return toClob ( sw . toString ( ) ) ; } return toClob ( Caster . toString ( value ) ) ; } | cast given value to a clob |
23,161 | public static final String crypt ( String original ) { java . util . Random randomGenerator = new java . util . Random ( ) ; int numSaltChars = saltChars . length ; String salt ; salt = ( new StringBuffer ( ) ) . append ( saltChars [ Math . abs ( randomGenerator . nextInt ( ) ) % numSaltChars ] ) . append ( saltChars [ Math . abs ( randomGenerator . nextInt ( ) ) % numSaltChars ] ) . toString ( ) ; return crypt ( salt , original ) ; } | Encrypt a password given the cleartext password . This method generates a random salt using the java . util . Random class . |
23,162 | public void setKeyValue ( String strSection , String key , String value ) { Map section = getSectionEL ( strSection ) ; if ( section == null ) { section = newMap ( ) ; sections . put ( strSection . toLowerCase ( ) , section ) ; } section . put ( key . toLowerCase ( ) , value ) ; } | Sets the KeyValue attribute of the IniFile object |
23,163 | public Map getSection ( String strSection ) throws IOException { Object o = sections . get ( strSection . toLowerCase ( ) ) ; if ( o == null ) throw new IOException ( "section with name " + strSection + " does not exist" ) ; return ( Map ) o ; } | Gets the Section attribute of the IniFile object |
23,164 | public Map getSectionEL ( String strSection ) { Object o = sections . get ( strSection . toLowerCase ( ) ) ; if ( o == null ) return null ; return ( Map ) o ; } | Gets the Section attribute of the IniFile object return null if section not exist |
23,165 | public boolean isNullOrEmpty ( String section , String key ) { String value = getKeyValueEL ( section , key ) ; return ( value == null || value . length ( ) == 0 ) ; } | Gets the NullOrEmpty attribute of the IniFile object |
23,166 | public String getKeyValue ( String strSection , String key ) throws IOException { Object o = getSection ( strSection ) . get ( key . toLowerCase ( ) ) ; if ( o == null ) throw new IOException ( "key " + key + " doesn't exist in section " + strSection ) ; return ( String ) o ; } | Gets the KeyValue attribute of the IniFile object |
23,167 | public String getKeyValueEL ( String strSection , String key ) { Map map = getSectionEL ( strSection ) ; if ( map == null ) return null ; Object o = map . get ( key . toLowerCase ( ) ) ; if ( o == null ) return null ; return ( String ) o ; } | Gets the KeyValue attribute of the IniFile object if not exist return null |
23,168 | public void load ( InputStream in ) throws IOException { BufferedReader input = IOUtil . toBufferedReader ( new InputStreamReader ( in ) ) ; String read ; Map section = null ; String sectionName ; while ( ( read = input . readLine ( ) ) != null ) { if ( read . startsWith ( ";" ) || read . startsWith ( "#" ) ) { continue ; } else if ( read . startsWith ( "[" ) ) { sectionName = read . substring ( 1 , read . indexOf ( "]" ) ) . trim ( ) . toLowerCase ( ) ; section = getSectionEL ( sectionName ) ; if ( section == null ) { section = newMap ( ) ; sections . put ( sectionName , section ) ; } } else if ( read . indexOf ( "=" ) != - 1 && section != null ) { String key = read . substring ( 0 , read . indexOf ( "=" ) ) . trim ( ) . toLowerCase ( ) ; String value = read . substring ( read . indexOf ( "=" ) + 1 ) . trim ( ) ; section . put ( key , value ) ; } } } | loads the ini file |
23,169 | public void save ( ) throws IOException { if ( ! file . exists ( ) ) file . createFile ( true ) ; OutputStream out = IOUtil . toBufferedOutputStream ( file . getOutputStream ( ) ) ; Iterator it = sections . keySet ( ) . iterator ( ) ; PrintWriter output = new PrintWriter ( out ) ; try { while ( it . hasNext ( ) ) { String strSection = ( String ) it . next ( ) ; output . println ( "[" + strSection + "]" ) ; Map section = getSectionEL ( strSection ) ; Iterator iit = section . keySet ( ) . iterator ( ) ; while ( iit . hasNext ( ) ) { String key = ( String ) iit . next ( ) ; output . println ( key + "=" + section . get ( key ) ) ; } } } finally { IOUtil . flushEL ( output ) ; IOUtil . closeEL ( output ) ; IOUtil . flushEL ( out ) ; IOUtil . closeEL ( out ) ; } } | save back content to ini file |
23,170 | private final Switch switchStatement ( Data data ) throws TemplateException { if ( ! data . srcCode . forwardIfCurrent ( "switch" , '(' ) ) return null ; Position line = data . srcCode . getPosition ( ) ; comments ( data ) ; Expression expr = super . expression ( data ) ; comments ( data ) ; if ( ! data . srcCode . forwardIfCurrent ( ')' ) ) throw new TemplateException ( data . srcCode , "switch statement must end with a [)]" ) ; comments ( data ) ; if ( ! data . srcCode . forwardIfCurrent ( '{' ) ) throw new TemplateException ( data . srcCode , "switch statement must have a starting [{]" ) ; Switch swit = new Switch ( expr , line , null ) ; comments ( data ) ; while ( caseStatement ( data , swit ) ) { comments ( data ) ; } if ( defaultStatement ( data , swit ) ) { comments ( data ) ; } while ( caseStatement ( data , swit ) ) { comments ( data ) ; } if ( ! data . srcCode . forwardIfCurrent ( '}' ) ) throw new TemplateException ( data . srcCode , "invalid construct in switch statement" ) ; swit . setEnd ( data . srcCode . getPosition ( ) ) ; return swit ; } | Liest ein switch Statment ein |
23,171 | private final boolean caseStatement ( Data data , Switch swit ) throws TemplateException { if ( ! data . srcCode . forwardIfCurrentAndNoWordAfter ( "case" ) ) return false ; comments ( data ) ; Expression expr = super . expression ( data ) ; comments ( data ) ; if ( ! data . srcCode . forwardIfCurrent ( ':' ) ) throw new TemplateException ( data . srcCode , "case body must start with [:]" ) ; Body body = new BodyBase ( data . factory ) ; switchBlock ( data , body ) ; swit . addCase ( expr , body ) ; return true ; } | Liest ein Case Statement ein |
23,172 | private final boolean defaultStatement ( Data data , Switch swit ) throws TemplateException { if ( ! data . srcCode . forwardIfCurrent ( "default" , ':' ) ) return false ; Body body = new BodyBase ( data . factory ) ; swit . setDefaultCase ( body ) ; switchBlock ( data , body ) ; return true ; } | Liest ein default Statement ein |
23,173 | private final void switchBlock ( Data data , Body body ) throws TemplateException { while ( data . srcCode . isValidIndex ( ) ) { comments ( data ) ; if ( data . srcCode . isCurrent ( "case " ) || data . srcCode . isCurrent ( "default" , ':' ) || data . srcCode . isCurrent ( '}' ) ) return ; Body prior = data . setParent ( body ) ; statement ( data , body , CTX_SWITCH ) ; data . setParent ( prior ) ; } } | Liest ein Switch Block ein |
23,174 | private final boolean isFinish ( Data data ) throws TemplateException { comments ( data ) ; if ( data . tagName == null ) return false ; return data . srcCode . isCurrent ( "</" , data . tagName ) ; } | Prueft ob sich der Zeiger am Ende eines Script Blockes befindet |
23,175 | public List < URL > getURLS ( String html , URL url ) { List < URL > urls = new ArrayList < URL > ( ) ; SourceCode cfml = new SourceCode ( html , false , CFMLEngine . DIALECT_CFML ) ; while ( ! cfml . isAfterLast ( ) ) { if ( cfml . forwardIfCurrent ( '<' ) ) { for ( int i = 0 ; i < tags . length ; i ++ ) { if ( cfml . forwardIfCurrent ( tags [ i ] . tag + " " ) ) { getSingleUrl ( urls , cfml , tags [ i ] , url ) ; } } } else { cfml . next ( ) ; } } return urls ; } | returns all urls in a html String |
23,176 | public static boolean isCfmxCompat ( String algorithm ) { if ( StringUtil . isEmpty ( algorithm , true ) ) return true ; return algorithm . equalsIgnoreCase ( CFMXCompat . ALGORITHM_NAME ) ; } | returns true if the passed value is empty or is CFMX_COMPAT |
23,177 | public static TagLib [ ] loadFromDirectory ( Resource dir , Identification id ) throws TagLibException { if ( ! dir . isDirectory ( ) ) return new TagLib [ 0 ] ; ArrayList < TagLib > arr = new ArrayList < TagLib > ( ) ; Resource [ ] files = dir . listResources ( new ExtensionResourceFilter ( new String [ ] { "tld" , "tldx" } ) ) ; for ( int i = 0 ; i < files . length ; i ++ ) { if ( files [ i ] . isFile ( ) ) arr . add ( TagLibFactory . loadFromFile ( files [ i ] , id ) ) ; } return arr . toArray ( new TagLib [ arr . size ( ) ] ) ; } | Laedt mehrere TagLib s die innerhalb eines Verzeichnisses liegen . |
23,178 | private static TagLib [ ] loadFromSystem ( Identification id ) throws TagLibException { if ( systemTLDs [ CFMLEngine . DIALECT_CFML ] == null ) { TagLib cfml = new TagLibFactory ( null , TLD_BASE , id ) . getLib ( ) ; TagLib lucee = cfml . duplicate ( false ) ; systemTLDs [ CFMLEngine . DIALECT_CFML ] = new TagLibFactory ( cfml , TLD_CFML , id ) . getLib ( ) ; systemTLDs [ CFMLEngine . DIALECT_LUCEE ] = new TagLibFactory ( lucee , TLD_LUCEE , id ) . getLib ( ) ; } return systemTLDs ; } | Laedt die Systeminterne TLD . |
23,179 | public void setProxyport ( double proxyport ) throws ApplicationException { try { smtp . getProxyData ( ) . setPort ( ( int ) proxyport ) ; } catch ( Exception e ) { throw new ApplicationException ( "attribute [proxyport] of the tag [mail] is invalid" , e . getMessage ( ) ) ; } } | set the value proxyport The port number on the proxy server from which the object is requested . Default is 80 . When used with resolveURL the URLs of retrieved documents that specify a port number are automatically resolved to preserve links in the retrieved document . |
23,180 | public void setProxyuser ( String proxyuser ) throws ApplicationException { try { smtp . getProxyData ( ) . setUsername ( proxyuser ) ; } catch ( Exception e ) { throw new ApplicationException ( "attribute [proxyuser] of the tag [mail] is invalid" , e . getMessage ( ) ) ; } } | set the value username When required by a proxy server a valid username . |
23,181 | public void setProxypassword ( String proxypassword ) throws ApplicationException { try { smtp . getProxyData ( ) . setPassword ( proxypassword ) ; } catch ( Exception e ) { throw new ApplicationException ( "attribute [proxypassword] of the tag [mail] is invalid" , e . getMessage ( ) ) ; } } | set the value password When required by a proxy server a valid password . |
23,182 | public void setFrom ( Object from ) throws PageException { if ( StringUtil . isEmpty ( from , true ) ) throw new ApplicationException ( "attribute [from] cannot be empty" ) ; try { smtp . setFrom ( from ) ; } catch ( Exception e ) { throw Caster . toPageException ( e ) ; } } | set the value from The sender of the e - mail message . |
23,183 | public void setTo ( Object to ) throws ApplicationException { if ( StringUtil . isEmpty ( to ) ) return ; try { smtp . addTo ( to ) ; } catch ( Exception e ) { throw new ApplicationException ( "attribute [to] of the tag [mail] is invalid" , e . getMessage ( ) ) ; } } | set the value to The name of the e - mail message recipient . |
23,184 | public void setCc ( Object cc ) throws ApplicationException { if ( StringUtil . isEmpty ( cc ) ) return ; try { smtp . addCC ( cc ) ; } catch ( Exception e ) { throw new ApplicationException ( "attribute [cc] of the tag [mail] is invalid" , e . getMessage ( ) ) ; } } | set the value cc Indicates addresses to copy the e - mail message to ; cc stands for carbon copy . |
23,185 | public void setBcc ( Object bcc ) throws ApplicationException { if ( StringUtil . isEmpty ( bcc ) ) return ; try { smtp . addBCC ( bcc ) ; } catch ( Exception e ) { throw new ApplicationException ( "attribute [bcc] of the tag [mail] is invalid" , e . getMessage ( ) ) ; } } | set the value bcc Indicates addresses to copy the e - mail message to without listing them in the message header . bcc stands for blind carbon copy . |
23,186 | public void setType ( String type ) throws ApplicationException { type = type . toLowerCase ( ) . trim ( ) ; if ( type . equals ( "text/plain" ) || type . equals ( "plain" ) || type . equals ( "text" ) ) getPart ( ) . isHTML ( false ) ; else if ( type . equals ( "text/html" ) || type . equals ( "html" ) || type . equals ( "htm" ) ) getPart ( ) . isHTML ( true ) ; else throw new ApplicationException ( "attribute type of tag mail has an invalid values" , "valid values are [plain,text,html] but value is now [" + type + "]" ) ; } | set the value type Specifies extended type attributes for the message . |
23,187 | public void setMimeattach ( String strMimeattach , String fileName , String type , String disposition , String contentID , boolean removeAfterSend ) throws PageException { Resource file = ResourceUtil . toResourceNotExisting ( pageContext , strMimeattach ) ; pageContext . getConfig ( ) . getSecurityManager ( ) . checkFileLocation ( file ) ; if ( ! file . exists ( ) ) throw new ApplicationException ( "can't attach file " + strMimeattach + ", this file doesn't exist" ) ; smtp . addAttachment ( file , fileName , type , disposition , contentID , removeAfterSend ) ; } | set the value mimeattach Specifies the path of the file to be attached to the e - mail message . An attached file is MIME - encoded . |
23,188 | public void setParam ( String type , String file , String fileName , String name , String value , String disposition , String contentID , Boolean oRemoveAfterSend ) throws PageException { if ( file != null ) { boolean removeAfterSend = ( oRemoveAfterSend == null ) ? remove : oRemoveAfterSend . booleanValue ( ) ; setMimeattach ( file , fileName , type , disposition , contentID , removeAfterSend ) ; } else { if ( name . equalsIgnoreCase ( "bcc" ) ) setBcc ( value ) ; else if ( name . equalsIgnoreCase ( "cc" ) ) setCc ( value ) ; else if ( name . equalsIgnoreCase ( "charset" ) ) setCharset ( CharsetUtil . toCharset ( value , null ) ) ; else if ( name . equalsIgnoreCase ( "failto" ) ) setFailto ( value ) ; else if ( name . equalsIgnoreCase ( "from" ) ) setFrom ( value ) ; else if ( name . equalsIgnoreCase ( "mailerid" ) ) setMailerid ( value ) ; else if ( name . equalsIgnoreCase ( "mimeattach" ) ) setMimeattach ( value ) ; else if ( name . equalsIgnoreCase ( "priority" ) ) setPriority ( value ) ; else if ( name . equalsIgnoreCase ( "replyto" ) ) setReplyto ( value ) ; else if ( name . equalsIgnoreCase ( "subject" ) ) setSubject ( value ) ; else if ( name . equalsIgnoreCase ( "to" ) ) setTo ( value ) ; else smtp . addHeader ( name , value ) ; } } | sets a mail param |
23,189 | public Method [ ] getMethods ( Class clazz , Collection . Key methodName , int count ) { Map < Key , Array > methodsMap = map . get ( clazz ) ; if ( methodsMap == null ) methodsMap = store ( clazz ) ; Array methods = methodsMap . get ( methodName ) ; if ( methods == null ) return null ; Object o = methods . get ( count + 1 , null ) ; if ( o == null ) return null ; return ( Method [ ] ) o ; } | returns a methods matching given criteria or null if method doesn t exist |
23,190 | private void storeArgs ( Method method , Array methodArgs ) { Class [ ] pmt = method . getParameterTypes ( ) ; Method [ ] args ; synchronized ( methodArgs ) { Object o = methodArgs . get ( pmt . length + 1 , null ) ; if ( o == null ) { args = new Method [ 1 ] ; methodArgs . setEL ( pmt . length + 1 , args ) ; } else { Method [ ] ms = ( Method [ ] ) o ; args = new Method [ ms . length + 1 ] ; for ( int i = 0 ; i < ms . length ; i ++ ) { args [ i ] = ms [ i ] ; } methodArgs . setEL ( pmt . length + 1 , args ) ; } } args [ args . length - 1 ] = method ; } | stores arguments of a method |
23,191 | public Mapping getApplicationMapping ( String virtual , String physical ) { return getApplicationMapping ( "application" , virtual , physical , null , true , false ) ; } | FYI used by Extensions do not remove |
23,192 | StringBuilder fwdQuote ( char q ) { StringBuilder sb = new StringBuilder ( ) ; while ( hasNext ( ) ) { next ( ) ; sb . append ( buffer [ pos ] ) ; if ( isCurr ( q ) ) { if ( isNext ( q ) ) { next ( ) ; } else { break ; } } } if ( sb . length ( ) > 0 ) sb . setLength ( sb . length ( ) - 1 ) ; return sb ; } | forward pos until the end of quote |
23,193 | public static String getMD5Checksum ( Resource res ) throws Exception { byte [ ] b = createChecksum ( res ) ; String result = "" ; for ( int i = 0 ; i < b . length ; i ++ ) { result += Integer . toString ( ( b [ i ] & 0xff ) + 0x100 , 16 ) . substring ( 1 ) ; } return result ; } | a byte array to a HEX string |
23,194 | protected FTPWrap _get ( FTPConnection conn ) throws IOException , ApplicationException { FTPWrap wrap = null ; if ( ! conn . hasLoginData ( ) ) { if ( StringUtil . isEmpty ( conn . getName ( ) ) ) { throw new ApplicationException ( "can't connect ftp server, missing connection definition" ) ; } wrap = wraps . get ( conn . getName ( ) ) ; if ( wrap == null ) { throw new ApplicationException ( "can't connect ftp server, missing connection [" + conn . getName ( ) + "]" ) ; } else if ( ! wrap . getClient ( ) . isConnected ( ) || wrap . getConnection ( ) . getTransferMode ( ) != conn . getTransferMode ( ) ) { wrap . reConnect ( conn . getTransferMode ( ) ) ; } return wrap ; } String name = conn . hasName ( ) ? conn . getName ( ) : "__noname__" ; wrap = wraps . get ( name ) ; if ( wrap != null ) { if ( conn . loginEquals ( wrap . getConnection ( ) ) ) { return _get ( new FTPConnectionImpl ( name , null , null , null , conn . getPort ( ) , conn . getTimeout ( ) , conn . getTransferMode ( ) , conn . isPassive ( ) , conn . getProxyServer ( ) , conn . getProxyPort ( ) , conn . getProxyUser ( ) , conn . getProxyPassword ( ) , conn . getFingerprint ( ) , conn . getStopOnError ( ) , conn . secure ( ) ) ) ; } disconnect ( wrap . getClient ( ) ) ; } wrap = new FTPWrap ( conn ) ; wraps . put ( name , wrap ) ; return wrap ; } | returns a client from given connection |
23,195 | private void disconnect ( AFTPClient client ) { try { if ( client != null && client . isConnected ( ) ) { client . quit ( ) ; client . disconnect ( ) ; } } catch ( IOException ioe ) { } } | disconnect a client |
23,196 | static void createConfigFile ( String xmlName , Resource configFile ) throws IOException { configFile . createFile ( true ) ; createFileFromResource ( "/resource/config/" + xmlName + ".xml" , configFile . getAbsoluteResource ( ) ) ; } | creates the Config File if File not exist |
23,197 | static Element getChildByName ( Node parent , String nodeName ) { return getChildByName ( parent , nodeName , false ) ; } | return first direct child Elements of a Element with given Name |
23,198 | public static Key [ ] getColumnNames ( Query qry ) { Query qp = Caster . toQuery ( qry , null ) ; if ( qp != null ) return qp . getColumnNames ( ) ; String [ ] strNames = qry . getColumns ( ) ; Key [ ] names = new Key [ strNames . length ] ; for ( int i = 0 ; i < names . length ; i ++ ) { names [ i ] = KeyImpl . getInstance ( strNames [ i ] ) ; } return names ; } | return column names as Key from a query |
23,199 | public static void checkSQLRestriction ( DatasourceConnection dc , SQL sql ) throws PageException { Array sqlparts = ListUtil . listToArrayRemoveEmpty ( SQLUtil . removeLiterals ( sql . getSQLString ( ) ) , " \t" + System . getProperty ( "line.separator" ) ) ; DataSource ds = dc . getDatasource ( ) ; if ( ! ds . hasAllow ( DataSource . ALLOW_ALTER ) ) checkSQLRestriction ( dc , "alter" , sqlparts , sql ) ; if ( ! ds . hasAllow ( DataSource . ALLOW_CREATE ) ) checkSQLRestriction ( dc , "create" , sqlparts , sql ) ; if ( ! ds . hasAllow ( DataSource . ALLOW_DELETE ) ) checkSQLRestriction ( dc , "delete" , sqlparts , sql ) ; if ( ! ds . hasAllow ( DataSource . ALLOW_DROP ) ) checkSQLRestriction ( dc , "drop" , sqlparts , sql ) ; if ( ! ds . hasAllow ( DataSource . ALLOW_GRANT ) ) checkSQLRestriction ( dc , "grant" , sqlparts , sql ) ; if ( ! ds . hasAllow ( DataSource . ALLOW_INSERT ) ) checkSQLRestriction ( dc , "insert" , sqlparts , sql ) ; if ( ! ds . hasAllow ( DataSource . ALLOW_REVOKE ) ) checkSQLRestriction ( dc , "revoke" , sqlparts , sql ) ; if ( ! ds . hasAllow ( DataSource . ALLOW_SELECT ) ) checkSQLRestriction ( dc , "select" , sqlparts , sql ) ; if ( ! ds . hasAllow ( DataSource . ALLOW_UPDATE ) ) checkSQLRestriction ( dc , "update" , sqlparts , sql ) ; } | check if there is a sql restriction |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.