input
stringlengths
10
828
output
stringlengths
5
107
public boolean accept file dir string name for int i 0 i wildcards length i if filename utils wildcard match name wildcards i case sensitivity return true return false
checks to see if the filename matches one of the wildcards
public boolean accept file file string name file get name for int i 0 i wildcards length i if filename utils wildcard match name wildcards i case sensitivity return true return false
checks to see if the filename matches one of the wildcards
public string to string string buffer buffer new string buffer buffer append super to string buffer append if wildcards null for int i 0 i wildcards length i if i 0 buffer append buffer append wildcards i buffer append return buffer to string
provide a string representaion of this file filter
public boolean accept file file if file is directory file files file list files return files null files length 0 else return file length 0
checks to see if the file is empty
public boolean accept file file return file is hidden
checks to see if the file is hidden
public boolean accept file dir string name return pattern matcher name matches
checks to see if the filename matches one of the regular expressions
public boolean accept file file return file is directory
checks to see if the file is a directory
public boolean accept file file string name file get name for int i 0 i this suffixes length i if case sensitivity check ends with name suffixes i return true return false
checks to see if the filename ends with the suffix
public boolean accept file file string name for int i 0 i this suffixes length i if case sensitivity check ends with name suffixes i return true return false
checks to see if the filename ends with the suffix
public string to string string buffer buffer new string buffer buffer append super to string buffer append if suffixes null for int i 0 i suffixes length i if i 0 buffer append buffer append suffixes i buffer append return buffer to string
provide a string representaion of this file filter
public boolean accept file file return file can write
checks to see if the file can be written to
public boolean accept file file return filter accept file
checks to see if both filters are true
public boolean accept file file string name return filter accept file name
checks to see if both filters are true
public string to string return super to string filter to string
provide a string representaion of this file filter
public boolean accept file file return file is file
checks to see if the file is a file
public boolean accept file file string name file get name for int i 0 i this names length i if case sensitivity check equals name names i return true return false
checks to see if the filename matches
public boolean accept file file string name for int i 0 i names length i if case sensitivity check equals name names i return true return false
checks to see if the filename matches
public string to string string buffer buffer new string buffer buffer append super to string buffer append if names null for int i 0 i names length i if i 0 buffer append buffer append names i buffer append return buffer to string
provide a string representaion of this file filter
public string to string string name get class get name int period name last index of return period 0 name substring period 1 name
provide a string representaion of this file filter
public boolean accept file file boolean smaller file length size return accept larger smaller smaller
checks to see if the size of the file is favorable
public string to string string condition accept larger return super to string condition size
provide a string representaion of this file filter
public void run thread exits when exit when finished is true and there are no more tracked objects while exit when finished false trackers size 0 tracker tracker null try wait for a tracker to remove tracker tracker q remove catch exception e continue if tracker null tracker delete tracker clear trackers remove tracker
run the reaper thread that will delete files as their associated
protected void handle start file start directory collection results throws ioexception do nothing overridable by subclass
overridable callback method invoked at the start of processing
public string to string return file delete strategy name
gets a string describing the delete strategy
protected boolean do delete file file to delete throws ioexception file utils force delete file to delete return true
deletes the file object
protected boolean handle directory file directory int depth collection results throws ioexception do nothing overridable by subclass return true process directory
overridable callback method invoked to determine if a directory should be processed
public boolean has next if cached line null return true else if finished return false else try while true string line buffered reader read line if line null finished true return false else if is valid line line cached line line return true catch ioexception ioe close throw new illegal state exception ioe to string
indicates whether the code reader code has more lines
public object next return next line
returns the next line in the wrapped code reader code
protected void handle directory start file directory int depth collection results throws ioexception do nothing overridable by subclass
overridable callback method invoked at the start of processing each directory
public void write int idx throws ioexception out write idx
write a character
protected void handle file file file int depth collection results throws ioexception do nothing overridable by subclass
overridable callback method invoked for each non directory file
public void write char chr throws ioexception out write chr
write the characters from an array
public void write char chr int st int end throws ioexception out write chr st end
write the specified characters from an array
public void write string str throws ioexception out write str
write the characters from a string
protected void handle restricted file directory int depth collection results throws ioexception do nothing overridable by subclass
overridable callback method invoked for each restricted directory
public void write string str int st int end throws ioexception out write str st end
write the specified characters from a string
protected void handle directory end file directory int depth collection results throws ioexception do nothing overridable by subclass
overridable callback method invoked at the end of processing each directory
protected void handle end collection results throws ioexception do nothing overridable by subclass
overridable callback method invoked at the end of processing
public void close throws ioexception try out close finally lock file delete
closes the file writer
public void write int idx to dev null
does nothing output to code dev null code
public void write char chr to dev null
does nothing output to code dev null code
public void write char chr int st int end to dev null
does nothing output to code dev null code
public void write string str to dev null
does nothing output to code dev null code
public void write string str int st int end to dev null
does nothing output to code dev null code
public void write byte b throws ioexception count b length super write b
writes the contents of the specified byte array to this output stream
public void write byte b int off int len to dev null
does nothing output to code dev null code
public void write byte b int off int len throws ioexception count len super write b off len
writes a portion of the specified byte array to this output stream
public void write int b to dev null
does nothing output to code dev null code
public void write byte b throws ioexception to dev null
does nothing output to code dev null code
public void flush throws ioexception super flush this branch flush
flushes both streams
public void close throws ioexception super close this branch close
closes both streams
private void need new buffer int newcount if current buffer index buffers size 1 recycling old buffer filled buffer sum current buffer length current buffer index current buffer get buffer current buffer index else creating new buffer int new buffer size if current buffer null new buffer size newcount filled buffer sum 0 else new buffer size math max current buffer length 1 newcount filled buffer sum filled buffer sum current buffer length current buffer index current buffer new byte new buffer size buffers add current buffer
makes a new buffer available either by allocating
public void write byte b int off int len if off 0 off b length len 0 off len b length off len 0 throw new index out of bounds exception else if len 0 return synchronized this int newcount count len int remaining len int in buffer pos count filled buffer sum while remaining 0 int part math min remaining current buffer length in buffer pos system arraycopy b off len remaining current buffer in buffer pos part remaining part if remaining 0 need new buffer newcount in buffer pos 0 count newcount
write the bytes to byte array
public void write byte bts throws ioexception out write bts
invokes the delegates code write byte code method
public void write byte bts int st int end throws ioexception out write bts st end
invokes the delegates code write byte code method
public string to string return new string to byte array
gets the curent contents of this byte stream as a string
public void close out new closed output stream
replaces the underlying output stream with a
public int read throws ioexception return in read
invokes the delegates code read code method
public void close idx 0 mark 0
close resets the file back to the start and removes any marked position
public int read char chr throws ioexception return in read chr
invokes the delegates code read char code method
public void mark int read ahead limit mark idx
mark the current position
public int read char chr int st int end throws ioexception return in read chr st end
invokes the delegates code read char int int code method
public void close throws ioexception try super close finally if close branch branch close
closes the proxied input stream and if so configured the associated
public long skip long ln throws ioexception return in skip ln
invokes the delegates code skip long code method
public int read throws ioexception int ch super read if ch 1 branch write ch return ch
reads a single byte from the proxied input stream and writes it to
public void close throws ioexception in close in new closed input stream
closes the underlying input stream and replaces the reference to it
public boolean ready throws ioexception return in ready
invokes the delegates code ready code method
public int read byte bts int st int end throws ioexception int n super read bts st end if n 1 branch write bts st n return n
reads bytes from the proxied input stream and writes the read bytes
public int read if idx char sequence length return 1 else return char sequence char at idx
read a single character
public int read throws ioexception int n in read if n 1 close return n
reads and returns a single byte from the underlying input stream
public int read byte b throws ioexception int n in read b if n 1 close return n
reads and returns bytes from the underlying input stream to the given
public int read byte bts throws ioexception int n super read bts if n 1 branch write bts 0 n return n
reads bytes from the proxied input stream and writes the read bytes
public int read char array int offset int length if idx char sequence length return 1 if array null throw new null pointer exception character array is missing if length 0 offset length array length throw new index out of bounds exception array size array length offset offset length length int count 0 for int i 0 i length i int c read if c 1 return count array offset i char c count return count
read the sepcified number of characters into the array
public boolean mark supported return in mark supported
invokes the delegates code mark supported code method
public int read return 1
returns 1 to indicate that the stream is closed
public int read byte b int off int len throws ioexception int n in read b off len if n 1 close return n
reads and returns bytes from the underlying input stream to the given
public void reset idx mark
reset the reader to the last marked position or the beginning if
protected void finalize throws throwable close super finalize
ensures that the stream is closed before it gets garbage collected
public long skip long n if n 0 throw new illegal argument exception number of characters to skip is less than zero n if idx char sequence length return 1 int dest int math min char sequence length idx n int count dest idx idx dest return count
skip the specified number of characters
public string to string return char sequence to string
return a string representation of the underlying
public int read byte bts throws ioexception return in read bts
invokes the delegates code read byte code method
public int read byte bts int st int end throws ioexception return in read bts st end
invokes the delegates code read byte int int code method
public int available throws ioexception return in available
invokes the delegates code available code method
public void close throws ioexception eof false position 0 mark 1
close this reader resets the internal state to
public int available long avail size position if avail 0 return 0 else if avail integer max value return integer max value else return int avail
return the number of bytes that can be read
public boolean mark supported return mark supported
indicates whether i mark i is supported
public int read byte b throws ioexception int found super read b this count found 0 found 0 return found
reads a number of bytes into the byte array keeping count of the
public int read throws ioexception if eof throw new ioexception read after end of file if position size return do end of file position return process char
read a character
public int read byte b int off int len throws ioexception int found super read b off len this count found 0 found 0 return found
reads a number of bytes into the byte array at a specific offset
public int read throws ioexception int found super read this count found 0 1 0 return found
reads the next byte of data adding to the count of bytes received
public int read throws ioexception if eof throw new ioexception read after end of file if position size return do end of file position return process byte
read a byte
public int read char chars throws ioexception return read chars 0 chars length
read some characters into the specified array
public long skip final long length throws ioexception final long skip super skip length this count skip return skip
skips the stream over the specified number of bytes adding the skipped
public void close in new closed input stream
replaces the underlying input stream with a
public int read byte bytes throws ioexception return read bytes 0 bytes length
read some bytes into the specified array
public int read char chars int offset int length throws ioexception if eof throw new ioexception read after end of file if position size return do end of file position length int return length length if position size return length length int position size position size process chars chars offset return length return return length
read the specified number characters into an array
public int compare object obj1 object obj2 file file1 file obj1 file file2 file obj2 return file1 compare to file2
compare the two files using the
public int read byte bytes int offset int length throws ioexception if eof throw new ioexception read after end of file if position size return do end of file position length int return length length if position size return length length int position size position size process bytes bytes offset return length return return length
read the specified number bytes into an array
public int compare object obj1 object obj2 return delegate compare obj2 obj1 parameters switched round
compare using the delegate comparator but reversing the result
public long skip long number of chars throws ioexception if eof throw new ioexception skip after end of file if position size return do end of file position number of chars long return length number of chars if position size return length number of chars position size position size return return length
skip a specified number of characters