idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
22,900
public void updateLocale ( String locale ) throws SecurityException { checkWriteAccess ( ) ; boolean hasAccess = ConfigWebUtil . hasAccess ( config , SecurityManager . TYPE_SETTING ) ; if ( ! hasAccess ) throw new SecurityException ( "no access to update regional setting" ) ; Element scope = _getRootElement ( "regional...
update the locale
22,901
public void updateTimeZone ( String timeZone ) throws SecurityException { checkWriteAccess ( ) ; boolean hasAccess = ConfigWebUtil . hasAccess ( config , SecurityManager . TYPE_SETTING ) ; if ( ! hasAccess ) throw new SecurityException ( "no access to update regional setting" ) ; Element regional = _getRootElement ( "r...
update the timeZone
22,902
public void updateTimeServer ( String timeServer , Boolean useTimeServer ) throws PageException { checkWriteAccess ( ) ; if ( useTimeServer != null && useTimeServer . booleanValue ( ) && ! StringUtil . isEmpty ( timeServer , true ) ) { try { new NtpClient ( timeServer ) . getOffset ( ) ; } catch ( IOException e ) { try...
update the timeServer
22,903
public void updateBaseComponent ( String baseComponentCFML , String baseComponentLucee ) throws SecurityException { checkWriteAccess ( ) ; boolean hasAccess = ConfigWebUtil . hasAccess ( config , SecurityManager . TYPE_SETTING ) ; if ( ! hasAccess ) throw new SecurityException ( "no access to update component setting" ...
update the baseComponent
22,904
public void updateDebug ( Boolean debug , Boolean database , Boolean exception , Boolean tracing , Boolean dump , Boolean timer , Boolean implicitAccess , Boolean queryUsage ) throws SecurityException { checkWriteAccess ( ) ; boolean hasAccess = ConfigWebUtil . hasAccess ( config , SecurityManager . TYPE_DEBUGGING ) ; ...
updates if debugging or not
22,905
public void updateErrorTemplate ( int statusCode , String template ) throws SecurityException { checkWriteAccess ( ) ; boolean hasAccess = ConfigWebUtil . hasAccess ( config , SecurityManager . TYPE_DEBUGGING ) ; if ( ! hasAccess ) throw new SecurityException ( "no access to change error settings" ) ; Element error = _...
updates the ErrorTemplate
22,906
public void updateSessionType ( String type ) throws SecurityException { checkWriteAccess ( ) ; boolean hasAccess = ConfigWebUtil . hasAccess ( config , SecurityManager . TYPE_SETTING ) ; if ( ! hasAccess ) throw new SecurityException ( "no access to update scope setting" ) ; type = type . toLowerCase ( ) . trim ( ) ; ...
session type update
22,907
public void updateUpdate ( String type , String location ) throws SecurityException { checkWriteAccess ( ) ; if ( ! ( config instanceof ConfigServer ) ) { throw new SecurityException ( "can't change update setting from this context, access is denied" ) ; } Element update = _getRootElement ( "update" ) ; update . setAtt...
updates update settingd for Lucee
22,908
public void removeSecurityManager ( Password password , String id ) throws PageException { checkWriteAccess ( ) ; ( ( ConfigServerImpl ) ConfigImpl . getConfigServer ( config , password ) ) . removeSecurityManager ( id ) ; Element security = _getRootElement ( "security" ) ; Element [ ] children = XMLConfigWebFactory . ...
remove security manager matching given id
22,909
public void runUpdate ( Password password ) throws PageException { checkWriteAccess ( ) ; ConfigServerImpl cs = ( ConfigServerImpl ) ConfigImpl . getConfigServer ( config , password ) ; CFMLEngineFactory factory = cs . getCFMLEngine ( ) . getCFMLEngineFactory ( ) ; synchronized ( factory ) { try { cleanUp ( factory ) ;...
run update from cfml engine
22,910
public static RHExtension hasRHExtensions ( ConfigImpl config , ExtensionDefintion ed ) throws PageException , SAXException , IOException { XMLConfigAdmin admin = new XMLConfigAdmin ( config , null ) ; return admin . _hasRHExtensions ( config , ed ) ; }
returns the version if the extension is available
22,911
public static boolean call ( PageContext pc , String str ) { try { return pc . evaluate ( str ) == null ; } catch ( PageException e ) { return true ; } }
called by modifed call from translation time evaluator
22,912
public void setTimeout ( Object oTimeout ) throws PageException { if ( oTimeout instanceof TimeSpan ) this . timeoutInMillis = toInt ( ( ( TimeSpan ) oTimeout ) . getMillis ( ) ) ; else this . timeoutInMillis = toInt ( Caster . toDoubleValue ( oTimeout ) * 1000D ) ; }
set the value timeout Specifies the maximum amount of time in seconds to wait to obtain a lock . If a lock can be obtained within the specified period execution continues inside the body of the tag . Otherwise the behavior depends on the value of the throwOnTimeout attribute .
22,913
public void setName ( String name ) throws ApplicationException { if ( name == null ) return ; this . name = name . trim ( ) ; if ( name . length ( ) == 0 ) throw new ApplicationException ( "invalid attribute definition" , "attribute [name] can't be a empty string" ) ; }
set the value name
22,914
public static ResourceSnippet createResourceSnippet ( InputStream is , int startChar , int endChar , String charset ) { return createResourceSnippet ( getContents ( is , charset ) , startChar , endChar ) ; }
extract a ResourceSnippet from InputStream at the given char positions
22,915
public static ResourceSnippet createResourceSnippet ( Resource res , int startChar , int endChar , String charset ) { try { return createResourceSnippet ( res . getInputStream ( ) , startChar , endChar , charset ) ; } catch ( IOException ex ) { return ResourceSnippet . Empty ; } }
extract a ResourceSnippet from a Resource at the given char positions
22,916
public static int getLineNumber ( String text , int posChar ) { int len = Math . min ( posChar , text . length ( ) ) ; int result = 1 ; for ( int i = 0 ; i < len ; i ++ ) { if ( text . charAt ( i ) == '\n' ) result ++ ; } return result ; }
returns the line number of the given char in the text
22,917
public static Password getPassword ( PageContext pc , String password , boolean server ) throws lucee . runtime . exp . SecurityException { if ( StringUtil . isEmpty ( password , true ) ) { ApplicationContext appContext = pc . getApplicationContext ( ) ; if ( appContext instanceof ModernApplicationContext ) password = ...
returns true if the webAdminPassword matches the passed password if one is passed or a password defined in Application . cfc as this . webAdminPassword if null or empty - string is passed for password
22,918
public String getContentType ( ) { URLConnection connection = null ; try { connection = url . openConnection ( ) ; } catch ( IOException e ) { } if ( connection == null ) return DEFAULT_CONTENT_TYPE ; return connection . getContentType ( ) ; }
Returns the value of the URL content - type header field
22,919
public InputStream getInputStream ( ) throws IOException { if ( barr == null ) { barr = IOUtil . toBytes ( url . openStream ( ) ) ; } return new ByteArrayInputStream ( barr ) ; }
Returns an InputStream obtained from the data source
22,920
public OutputStream getOutputStream ( ) throws IOException { URLConnection connection = url . openConnection ( ) ; if ( connection == null ) return null ; connection . setDoOutput ( true ) ; return connection . getOutputStream ( ) ; }
Returns an OutputStream obtained from the data source
22,921
public static short toType ( String strType ) throws RegistryException { if ( strType . equals ( REGDWORD_TOKEN ) ) return RegistryEntry . TYPE_DWORD ; else if ( strType . equals ( REGSTR_TOKEN ) ) return RegistryEntry . TYPE_STRING ; else if ( strType . equals ( REGKEY_TOKEN ) ) return RegistryEntry . TYPE_KEY ; throw...
cast a String type to a short Type
22,922
private void expungeStaleEntries ( ) { for ( Object x ; ( x = queue . poll ( ) ) != null ; ) { synchronized ( queue ) { @ SuppressWarnings ( "unchecked" ) Entry < K , V > e = ( Entry < K , V > ) x ; int i = indexFor ( e . hash , table . length ) ; Entry < K , V > prev = table [ i ] ; Entry < K , V > p = prev ; while ( ...
Expunges stale entries from the table .
22,923
Entry < K , V > getEntry ( Object key ) { Object k = maskNull ( key ) ; int h = hash ( k ) ; Entry < K , V > [ ] tab = getTable ( ) ; int index = indexFor ( h , tab . length ) ; Entry < K , V > e = tab [ index ] ; while ( e != null && ! ( e . hash == h && eq ( k , e . get ( ) ) ) ) e = e . next ; return e ; }
Returns the entry associated with the specified key in this map . Returns null if the map contains no mapping for this key .
22,924
public void registerResourceProvider ( ResourceProvider provider ) { provider . setResources ( this ) ; String scheme = provider . getScheme ( ) ; if ( StringUtil . isEmpty ( scheme ) ) return ; ResourceProviderFactory [ ] tmp = new ResourceProviderFactory [ resources . length + 1 ] ; for ( int i = 0 ; i < resources . ...
adds a additional resource to System
22,925
public Resource getResource ( String path ) { int index = path . indexOf ( "://" ) ; if ( index != - 1 ) { String scheme = path . substring ( 0 , index ) . toLowerCase ( ) . trim ( ) ; String subPath = path . substring ( index + 3 ) ; for ( int i = 0 ; i < resources . length ; i ++ ) { if ( scheme . equalsIgnoreCase ( ...
returns a resource that matching the given path
22,926
private int getPid ( ) { PageContext pc = ThreadLocalPageContext . get ( ) ; if ( pc == null ) { pc = CFMLEngineFactory . getInstance ( ) . getThreadPageContext ( ) ; if ( pc == null ) throw new RuntimeException ( "cannot get pid for current thread" ) ; } return pc . getId ( ) ; }
private static int pidc = 0 ;
22,927
public String getColumnlist ( boolean upperCase ) { StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < columnNames . length ; i ++ ) { if ( i > 0 ) sb . append ( ',' ) ; sb . append ( upperCase ? columnNames [ i ] . getUpperString ( ) : columnNames [ i ] . getString ( ) ) ; } return sb . toString ( ) ; }
return a string list of all columns
22,928
public synchronized void sort ( String strColumn , int order ) throws PageException { sort ( getColumn ( strColumn ) , order ) ; }
sorts a query by a column
22,929
private Object _deserializeQuery ( Element recordset ) throws ConverterException { try { Query query = new QueryImpl ( lucee . runtime . type . util . ListUtil . listToArray ( recordset . getAttribute ( "fieldNames" ) , ',' ) , Caster . toIntValue ( recordset . getAttribute ( "rowCount" ) ) , "query" ) ; NodeList list ...
Desirialize a Query Object
22,930
private void _deserializeQueryField ( Query query , Element field ) throws PageException , ConverterException { String name = field . getAttribute ( "name" ) ; NodeList list = field . getChildNodes ( ) ; int len = list . getLength ( ) ; int count = 0 ; for ( int i = 0 ; i < len ; i ++ ) { Node node = list . item ( i ) ...
deserilize a single Field of a query WDDX Object
22,931
private Object _deserializeComponent ( Element elComp ) throws ConverterException { String name = elComp . getAttribute ( "name" ) ; String md5 = elComp . getAttribute ( "md5" ) ; PageContext pc = ThreadLocalPageContext . get ( ) ; Component comp = null ; try { comp = pc . loadComponent ( name ) ; if ( ! ComponentUtil ...
Desirialize a Component Object
22,932
private Element getChildElement ( Element parent ) { NodeList list = parent . getChildNodes ( ) ; int len = list . getLength ( ) ; for ( int i = 0 ; i < len ; i ++ ) { Node node = list . item ( i ) ; if ( node instanceof Element ) { return ( Element ) node ; } } return null ; }
return fitst child Element of a Element if there are no child Elements return null
22,933
public String format ( Locale locale , double number ) { DecimalFormat df = getDecimalFormat ( locale ) ; df . applyPattern ( ",0" ) ; df . setGroupingSize ( 3 ) ; return df . format ( number ) ; }
formats a number
22,934
public String formatX ( Locale locale , double number , String mask ) throws InvalidMaskException { return format ( locale , number , convertMask ( mask ) ) ; }
format a number with given mask
22,935
private void enlargeOffset ( ) { if ( offset == 0 ) { offCount = offCount == 0 ? 1 : offCount * 2 ; offset = offCount ; Object [ ] narr = new Object [ arr . length + offset ] ; for ( int i = 0 ; i < size ; i ++ ) { narr [ offset + i ] = arr [ i ] ; } arr = narr ; } }
!!! all methods that use this method must be sync enlarge the offset if 0
22,936
private Boolean isInsideCITemplate ( Page page ) { SourceCode sc = page . getSourceCode ( ) ; if ( ! ( sc instanceof PageSourceCode ) ) return null ; PageSource psc = ( ( PageSourceCode ) sc ) . getPageSource ( ) ; String src = psc . getDisplayPath ( ) ; return Constants . isComponentExtension ( ResourceUtil . getExten...
is the template ending with a component extension?
22,937
public static Number toNumber ( String str , Number defaultValue ) { try { if ( str . indexOf ( '.' ) != - 1 ) { return new BigDecimal ( str ) ; } BigInteger bi = new BigInteger ( str ) ; int l = bi . bitLength ( ) ; if ( l < 32 ) return new Integer ( bi . intValue ( ) ) ; if ( l < 64 ) return new Long ( bi . longValue...
returns a number Object this can be a BigDecimal BigInteger Long Double depending on the input .
22,938
public static String toString3 ( double d ) { long l = ( long ) d ; if ( l == d ) return toString ( l ) ; String str = Double . toString ( d ) ; int pos ; if ( ( pos = str . indexOf ( 'E' ) ) != - 1 && pos == str . length ( ) - 2 ) { return new StringBuffer ( pos + 2 ) . append ( str . charAt ( 0 ) ) . append ( str . s...
cast a double value to a String
22,939
public static byte [ ] toBinary ( Object o ) throws PageException { if ( o instanceof byte [ ] ) return ( byte [ ] ) o ; else if ( o instanceof ObjectWrap ) return toBinary ( ( ( ObjectWrap ) o ) . getEmbededObject ( "" ) ) ; else if ( o instanceof InputStream ) { ByteArrayOutputStream barr = new ByteArrayOutputStream ...
cast a Object to a Binary
22,940
public static String toBase64 ( Object o , String charset , String defaultValue ) { ; if ( o instanceof byte [ ] ) return toB64 ( ( byte [ ] ) o , defaultValue ) ; else if ( o instanceof String ) return toB64 ( ( String ) o , charset , defaultValue ) ; else if ( o instanceof Number ) return toB64 ( toString ( ( ( Numbe...
cast a Object to a Base64 value
22,941
public static QueryColumn toQueryColumn ( Object o ) throws PageException { if ( o instanceof QueryColumn ) return ( QueryColumn ) o ; throw new CasterException ( o , "querycolumn" ) ; }
converts a object to a QueryColumn if possible
22,942
public static QueryColumn toQueryColumn ( Object o , PageContext pc ) throws PageException { if ( o instanceof QueryColumn ) return ( QueryColumn ) o ; if ( o instanceof String ) { o = VariableInterpreter . getVariableAsCollection ( pc , ( String ) o ) ; if ( o instanceof QueryColumn ) return ( QueryColumn ) o ; } thro...
converts a object to a QueryColumn if possible also variable declarations are allowed . this method is used within the generated bytecode
22,943
public static Collection toCollection ( Object o ) throws PageException { if ( o instanceof Collection ) return ( Collection ) o ; else if ( o instanceof Node ) return XMLCaster . toXMLStruct ( ( Node ) o , false ) ; else if ( o instanceof Map ) { return MapAsStruct . toStruct ( ( Map ) o , true ) ; } else if ( o insta...
cast a Object to a Collection
22,944
public static Component toComponent ( Object o ) throws PageException { if ( o instanceof Component ) return ( Component ) o ; else if ( o instanceof ObjectWrap ) { return toComponent ( ( ( ObjectWrap ) o ) . getEmbededObject ( ) ) ; } throw new CasterException ( o , "Component" ) ; }
cast a Object to a Component
22,945
public static Locale toLocale ( String strLocale , Locale defaultValue ) { return LocaleFactory . getLocale ( strLocale , defaultValue ) ; }
casts a string to a Locale
22,946
public static TimeZone toTimeZone ( String strTimeZone , TimeZone defaultValue ) { return TimeZoneUtil . toTimeZone ( strTimeZone , defaultValue ) ; }
casts a string to a TimeZone
22,947
public static Integer toInteger ( Object o , Integer defaultValue ) { if ( defaultValue != null ) return Integer . valueOf ( toIntValue ( o , defaultValue . intValue ( ) ) ) ; int res = toIntValue ( o , Integer . MIN_VALUE ) ; if ( res == Integer . MIN_VALUE ) return defaultValue ; return Integer . valueOf ( res ) ; }
casts a Object to a Integer
22,948
public final int doAfterBody ( ) throws JspException { BodyContent body = getBodyContent ( ) ; String s = body . getString ( ) . trim ( ) ; body . clearBody ( ) ; if ( output_date == null ) { long time ; try { time = Long . valueOf ( s ) . longValue ( ) ; output_date = new Date ( time ) ; } catch ( NumberFormatExceptio...
Method called at end of format tag body .
22,949
public final int doEndTag ( ) throws JspException { String date_formatted = default_text ; if ( output_date != null ) { SimpleDateFormat sdf ; String pat = pattern ; if ( pat == null && patternid != null ) { Object attr = pageContext . findAttribute ( patternid ) ; if ( attr != null ) pat = attr . toString ( ) ; } if (...
Method called at end of Tag
22,950
public synchronized Class < ? > loadClass ( String className ) throws ClassNotFoundException { PCLBlock cl = index . get ( className ) ; if ( cl != null ) { return cl . loadClass ( className ) ; } throw new ClassNotFoundException ( "class " + className + " not found" ) ; }
load existing class
22,951
public synchronized int shrink ( boolean force ) { int before = index . size ( ) ; int flushCFM = 0 ; while ( cfms . size ( ) > 1 ) { flush ( cfms . poll ( ) ) ; flushCFM ++ ; } if ( force && flushCFM < 2 && cfcs . size ( ) > 1 ) { flush ( oldest ( cfcs ) ) ; if ( cfcs . size ( ) > 1 ) flush ( cfcs . poll ( ) ) ; } ret...
shrink the classloader elements
22,952
public Object setE ( int key , Object value ) throws ExpressionException { if ( offset + key > arr . length ) enlargeCapacity ( key ) ; if ( key > size ) size = key ; arr [ ( offset + key ) - 1 ] = checkValue ( value ) ; return value ; }
set value at defined position
22,953
public boolean add ( Object o ) { if ( offset + size + 1 > arr . length ) enlargeCapacity ( size + 1 ) ; arr [ offset + size ] = o ; size ++ ; return true ; }
adds a value and return this array
22,954
protected void service ( HttpServletRequest req , HttpServletResponse rsp ) throws ServletException , IOException { String [ ] arrPath = ( req . getServletPath ( ) ) . split ( "\\." ) ; String pic = PIC_SOURCE + "404.gif" ; if ( arrPath . length >= 3 ) { pic = PIC_SOURCE + ( ( arrPath [ arrPath . length - 3 ] + "." + a...
Interpretiert den Script - Name und laedt das entsprechende Bild aus den internen Resourcen .
22,955
public static String getHashText ( String plainText , String algorithm ) throws NoSuchAlgorithmException { MessageDigest mdAlgorithm = MessageDigest . getInstance ( algorithm ) ; mdAlgorithm . update ( plainText . getBytes ( ) ) ; byte [ ] digest = mdAlgorithm . digest ( ) ; StringBuffer hexString = new StringBuffer ( ...
Method getHashText .
22,956
public void characters ( char ch [ ] , int start , int length ) { content . append ( new String ( ch , start , length ) ) ; }
Geerbte Methode von org . xml . sax . ContentHandler wird bei durchparsen des XML zum einlesen des Content eines Body Element aufgerufen .
22,957
public static FunctionLib [ ] loadFromDirectory ( Resource dir , Identification id ) throws FunctionLibException { if ( ! dir . isDirectory ( ) ) return new FunctionLib [ 0 ] ; ArrayList < FunctionLib > arr = new ArrayList < FunctionLib > ( ) ; Resource [ ] files = dir . listResources ( new ExtensionResourceFilter ( ne...
Laedt mehrere FunctionLib s die innerhalb eines Verzeichnisses liegen .
22,958
public static FunctionLib loadFromFile ( Resource res , Identification id ) throws FunctionLibException { FunctionLib lib = FunctionLibFactory . hashLib . get ( id ( res ) ) ; if ( lib == null ) { lib = new FunctionLibFactory ( null , res , id , false ) . getLib ( ) ; FunctionLibFactory . hashLib . put ( id ( res ) , l...
Laedt eine einzelne FunctionLib .
22,959
public static FunctionLib [ ] loadFromSystem ( Identification id ) throws FunctionLibException { if ( systemFLDs [ CFMLEngine . DIALECT_CFML ] == null ) { FunctionLib cfml = new FunctionLibFactory ( null , FLD_BASE , id , true ) . getLib ( ) ; FunctionLib lucee = cfml . duplicate ( false ) ; systemFLDs [ CFMLEngine . D...
Laedt die Systeminterne FLD .
22,960
private static void copyFunctions ( FunctionLib extFL , FunctionLib newFL ) { Iterator < Entry < String , FunctionLibFunction > > it = extFL . getFunctions ( ) . entrySet ( ) . iterator ( ) ; FunctionLibFunction flf ; while ( it . hasNext ( ) ) { flf = it . next ( ) . getValue ( ) ; newFL . setFunction ( flf ) ; } }
copy function from one FunctionLib to a other
22,961
private static void setAttributes ( FunctionLib extFL , FunctionLib newFL ) { newFL . setDescription ( extFL . getDescription ( ) ) ; newFL . setDisplayName ( extFL . getDisplayName ( ) ) ; newFL . setShortName ( extFL . getShortName ( ) ) ; newFL . setUri ( extFL . getUri ( ) ) ; newFL . setVersion ( extFL . getVersio...
copy attributes from old fld to the new
22,962
protected long encryptBlock ( long lPlainblock ) { lPlainblock ^= m_lCBCIV ; lPlainblock = super . encryptBlock ( lPlainblock ) ; return ( m_lCBCIV = lPlainblock ) ; }
internal routine to encrypt a block in CBC mode
22,963
protected long decryptBlock ( long lCipherblock ) { long lTemp = lCipherblock ; lCipherblock = super . decryptBlock ( lCipherblock ) ; lCipherblock ^= m_lCBCIV ; m_lCBCIV = lTemp ; return lCipherblock ; }
internal routine to decrypt a block in CBC mode
22,964
public void setMethod ( String method ) { method = method . toLowerCase ( ) ; if ( method . equals ( "loop" ) ) this . method = MODE_LOOP ; else if ( method . equals ( "exittag" ) ) this . method = MODE_EXIT_TAG ; else if ( method . equals ( "exittemplate" ) ) this . method = MODE_EXIT_TEMPLATE ; }
set the value method
22,965
private boolean isOK ( TimeSpan timeSpan ) { return res . exists ( ) && ( res . lastModified ( ) + timeSpan . getMillis ( ) >= System . currentTimeMillis ( ) ) ; }
private String name raw ;
22,966
public Range registerString ( BytecodeContext bc , String str ) throws IOException { boolean append = true ; if ( staticTextLocation == null ) { if ( bc . getPageSource ( ) == null ) return null ; PageSource ps = bc . getPageSource ( ) ; Mapping m = ps . getMapping ( ) ; staticTextLocation = m . getClassRootDirectory (...
return null if not possible to register
22,967
private static boolean hasChangesOfChildren ( long last , PageContext pc , Class clazz ) { java . lang . reflect . Method [ ] methods = clazz . getMethods ( ) ; java . lang . reflect . Method method ; Class [ ] params ; for ( int i = 0 ; i < methods . length ; i ++ ) { method = methods [ i ] ; if ( method . getDeclarin...
check if one of the children is changed
22,968
public static int toIntAccess ( String access ) throws ApplicationException { access = StringUtil . toLowerCase ( access . trim ( ) ) ; if ( access . equals ( "package" ) ) return Component . ACCESS_PACKAGE ; else if ( access . equals ( "private" ) ) return Component . ACCESS_PRIVATE ; else if ( access . equals ( "publ...
cast a strong access definition to the int type
22,969
public static String toStringAccess ( int access ) throws ApplicationException { String res = toStringAccess ( access , null ) ; if ( res != null ) return res ; throw new ApplicationException ( "invalid access type [" + access + "], access types are Component.ACCESS_PACKAGE, Component.ACCESS_PRIVATE, Component.ACCESS_P...
cast int type to string type
22,970
public void setAlign ( String align ) throws ApplicationException { align = StringUtil . toLowerCase ( align ) ; if ( align . equals ( "left" ) ) this . align = Table . ALIGN_LEFT ; else if ( align . equals ( "center" ) ) this . align = Table . ALIGN_CENTER ; else if ( align . equals ( "right" ) ) this . align = Table ...
set the value align Column alignment Left Right or Center .
22,971
public String serialize ( Object object , String clientVariableName ) throws ConverterException { StringBuilder sb = new StringBuilder ( ) ; _serialize ( clientVariableName , object , sb , new HashSet < Object > ( ) ) ; String str = sb . toString ( ) . trim ( ) ; return clientVariableName + "=" + str + ( StringUtil . e...
serialize a CFML object to a JavaScript Object
22,972
public static double call ( PageContext pc , double unit ) { if ( UNIT_NANO == unit ) return System . nanoTime ( ) ; if ( UNIT_MICRO == unit ) return System . nanoTime ( ) / 1000 ; if ( UNIT_MILLI == unit ) return System . currentTimeMillis ( ) ; return System . currentTimeMillis ( ) / 1000 ; }
this function is only called when the evaluator validates the unit definition on compilation time
22,973
public static Object indexOf ( String strPattern , String strInput , int offset , boolean caseSensitive , boolean matchAll ) throws MalformedPatternException { PatternMatcherInput input = new PatternMatcherInput ( strInput ) ; Perl5Matcher matcher = new Perl5Matcher ( ) ; int compileOptions = caseSensitive ? 0 : Perl5C...
return index of the first occurence of the pattern in input text
22,974
public static void deployWeb ( ConfigServer cs , ConfigWeb cw , boolean throwError ) throws IOException { Resource deploy = cs . getConfigDir ( ) . getRealResource ( "web-deployment" ) , trg ; if ( ! deploy . isDirectory ( ) ) return ; trg = cw . getRootDirectory ( ) ; try { _deploy ( cw , deploy , trg ) ; } catch ( IO...
deploys all content in web - deployment to a web context used for new context mostly or update existings
22,975
public static Resource getFile ( Config config , Resource directory , String path , short type ) { path = replacePlaceholder ( path , config ) ; if ( ! StringUtil . isEmpty ( path , true ) ) { Resource file = getFile ( directory . getRealResource ( path ) , type ) ; if ( file != null ) return file ; file = getFile ( co...
touch a file object by the string definition
22,976
static Resource getFile ( Resource rootDir , String strDir , String defaultDir , Resource configDir , short type , ConfigImpl config ) { strDir = replacePlaceholder ( strDir , config ) ; if ( ! StringUtil . isEmpty ( strDir , true ) ) { Resource res ; if ( strDir . indexOf ( "://" ) != - 1 ) { res = getFile ( config . ...
generate a file object by the string definition
22,977
public static Resource getExistingResource ( ServletContext sc , String strDir , String defaultDir , Resource configDir , short type , Config config ) { strDir = replacePlaceholder ( strDir , config ) ; if ( strDir != null && strDir . trim ( ) . length ( ) > 0 ) { Resource res = sc == null ? null : _getExistingFile ( c...
get only a existing file dont create it
22,978
public static boolean isFile ( Resource file ) { if ( file . exists ( ) ) return file . isFile ( ) ; Resource parent = file . getParentResource ( ) ; return parent . mkdirs ( ) && file . createNewFile ( ) ; }
checks if file is a file or not if file doesn t exist it will be created
22,979
public static boolean hasAccess ( Config config , int type ) { boolean has = true ; if ( config instanceof ConfigWeb ) { has = ( ( ConfigWeb ) config ) . getSecurityManager ( ) . getAccess ( type ) != SecurityManager . VALUE_NO ; } return has ; }
has access checks if config object has access to given type
22,980
public static String serialize ( Serializable o ) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; serialize ( o , baos ) ; return Base64Coder . encode ( baos . toByteArray ( ) ) ; }
serialize a Java Object of Type Serializable
22,981
public static Object deserialize ( String str ) throws IOException , ClassNotFoundException , CoderException { ByteArrayInputStream bais = new ByteArrayInputStream ( Base64Coder . decode ( str ) ) ; return deserialize ( bais ) ; }
unserialize a serialized Object
22,982
public static ComponentImpl loadComponent ( PageContext pc , Page page , String callPath , boolean isRealPath , boolean silent , boolean isExtendedComponent , boolean executeConstr ) throws PageException { CIPage cip = toCIPage ( page , callPath ) ; if ( silent ) { BodyContent bc = pc . pushBody ( ) ; try { return _loa...
do not change method is used in flex extension
22,983
public void setBufferConfig ( int bufferSize , boolean autoFlush ) throws IOException { this . bufferSize = bufferSize ; this . autoFlush = autoFlush ; _check ( ) ; }
reset configuration of buffer
22,984
public static ExprBoolean toExprBoolean ( Expression left , Expression right , int operation ) { return new OpDecision ( left , right , operation ) ; }
Create a String expression from a operation
22,985
public static BundleFile newInstance ( Resource res ) { try { BundleFile bf = new BundleFile ( res ) ; if ( bf . isBundle ( ) ) return bf ; } catch ( Throwable t ) { ExceptionUtil . rethrowIfNecessary ( t ) ; } return null ; }
only return a instance if the Resource is a valid bundle otherwise it returns null
22,986
private Page loadPhysical ( PageContext pc , Page page ) throws TemplateException { if ( ! mapping . hasPhysical ( ) ) return null ; ConfigWeb config = pc . getConfig ( ) ; PageContextImpl pci = ( PageContextImpl ) pc ; if ( ( mapping . getInspectTemplate ( ) == Config . INSPECT_NEVER || pci . isTrusted ( page ) ) && i...
throws only an exception when compilation fails
22,987
public String getDisplayPath ( ) { if ( ! mapping . hasArchive ( ) ) { return StringUtil . toString ( getPhyscalFile ( ) , null ) ; } else if ( isLoad ( LOAD_PHYSICAL ) ) { return StringUtil . toString ( getPhyscalFile ( ) , null ) ; } else if ( isLoad ( LOAD_ARCHIVE ) ) { return StringUtil . toString ( getArchiveSourc...
return source path as String
22,988
public Resource getPhyscalFile ( ) { if ( physcalSource == null ) { if ( ! mapping . hasPhysical ( ) ) { return null ; } Resource tmp = mapping . getPhysical ( ) . getRealResource ( relPath ) ; physcalSource = ResourceUtil . toExactResource ( tmp ) ; if ( ! tmp . getAbsolutePath ( ) . equals ( physcalSource . getAbsolu...
return file object based on physical path and realpath
22,989
private static String mergeRealPathes ( Mapping mapping , String parentRealPath , String newRealPath , RefBoolean isOutSide ) { parentRealPath = pathRemoveLast ( parentRealPath , isOutSide ) ; while ( newRealPath . startsWith ( "../" ) ) { parentRealPath = pathRemoveLast ( parentRealPath , isOutSide ) ; newRealPath = n...
merge to realpath to one
22,990
private static String list ( String [ ] arr , int from , int len ) { StringBuffer sb = new StringBuffer ( ) ; for ( int i = from ; i < len ; i ++ ) { sb . append ( arr [ i ] ) ; if ( i + 1 != arr . length ) sb . append ( '/' ) ; } return sb . toString ( ) ; }
convert a String array to a string list but only part of it
22,991
private static String pathRemoveLast ( String path , RefBoolean isOutSide ) { if ( path . length ( ) == 0 ) { isOutSide . setValue ( true ) ; return ".." ; } else if ( path . endsWith ( ".." ) ) { isOutSide . setValue ( true ) ; return path . concat ( "/.." ) ; } return path . substring ( 0 , path . lastIndexOf ( '/' )...
remove the last elemtn of a path
22,992
private InputStream getSourceAsInputStream ( ) throws IOException { if ( ! mapping . hasArchive ( ) ) return IOUtil . toBufferedInputStream ( getPhyscalFile ( ) . getInputStream ( ) ) ; else if ( isLoad ( LOAD_PHYSICAL ) ) return IOUtil . toBufferedInputStream ( getPhyscalFile ( ) . getInputStream ( ) ) ; else if ( isL...
return the inputstream of the source file
22,993
public void clear ( ClassLoader cl ) { Page page = this . page ; if ( page != null && page . getClass ( ) . getClassLoader ( ) . equals ( cl ) ) { this . page = null ; } }
clear page but only when page use the same classloader as provided
22,994
private static int toInterval ( String interval ) throws ScheduleException { interval = interval . trim ( ) . toLowerCase ( ) ; int i = Caster . toIntValue ( interval , 0 ) ; if ( i == 0 ) { interval = interval . trim ( ) ; if ( interval . equals ( "once" ) ) return INTERVAL_ONCE ; else if ( interval . equals ( "daily"...
translate a String interval definition to a int definition
22,995
private static URL toURL ( String url , int port ) throws MalformedURLException { URL u = HTTPUtil . toURL ( url , true ) ; if ( port == - 1 ) return u ; return new URL ( u . getProtocol ( ) , u . getHost ( ) , port , u . getFile ( ) ) ; }
translate a urlString and a port definition to a URL Object
22,996
public ResourceProvider init ( String scheme , Map arguments ) { if ( ! StringUtil . isEmpty ( scheme ) ) this . scheme = scheme ; if ( arguments != null ) { this . arguments = arguments ; Object oCaseSensitive = arguments . get ( "case-sensitive" ) ; if ( oCaseSensitive != null ) { caseSensitive = Caster . toBooleanVa...
initialize ram resource
22,997
public static String toStringScope ( int scope , String defaultValue ) { switch ( scope ) { case Scope . SCOPE_APPLICATION : return "application" ; case Scope . SCOPE_ARGUMENTS : return "arguments" ; case Scope . SCOPE_CALLER : return "caller" ; case Scope . SCOPE_CGI : return "cgi" ; case Scope . SCOPE_CLIENT : return...
cast a int scope definition to a string definition
22,998
public void release ( ) { this . base = null ; current = root ; current . body = null ; current . after = null ; current . before = null ; }
release the BodyContentStack
22,999
public BodyContent push ( ) { if ( current . after == null ) { current . after = new Entry ( current , new BodyContentImpl ( current . body == null ? ( JspWriter ) base : current . body ) ) ; } else { current . after . doDevNull = false ; current . after . body . init ( current . body == null ? ( JspWriter ) base : cur...
push a new BodyContent to Stack