Mailing User | 4 May 06:33 2016
Picon

[FTP] Handling the stream from retrieveFileStream()

InputStream x = retrieveFileStream();
 
When closing x, I have to call completePendingCommand(). And it seems I cannot retrieve another file
stream unless x has been already closed. This makes things complicated when x is used in nested,
multi-threaded codes.
 
How do I know if x is open and I need to close x? Or how do I know if the FTPClient has an opened stream? (I may
not simply call x.close() again when it has already been closed, because I need
to call completePendingCommand() after x.close(), and if x has already been closed, it feels it
would cause problems to call completePendingCommand() again.)
Mansour Al Akeel | 2 May 02:19 2016
Picon

[SCXML] Next states

Is there a way to get the next valid states or transitions ?
I am working with AbstractStateMachine

Thank you
Mailing User | 1 May 17:16 2016
Picon

[FTP] Create new client for retrieveFileStream()?

I searched Google for examples uses of Apache Commons FTP library, but only found very basic examples. For
efficiency and not to reach user limit, I used only one client.

When I called mlistFile(), I got an "java.lang.ArrayIndexOutOfBoundsException: length=1; index=1." at
    String entry = getReplyStrings()[1].substring(1); 

I found that at that time, getReplyStrings returned a String array that had only one element, and it was
    226 Successfully transferred "/somefile.mp4"
instead of the expected
    250-Listing /somefile.mp4
     type=file;size=1834618;modify=20090501101746; /somefile.mp4
    250 End

It seems that the response for MLST was mixed with a file close (InputStream.close()) response. What is the
best way to avoid this? Should I use a separate client for retrieveFileStream()?
Mansour Al Akeel | 1 May 01:40 2016
Picon

[SCXML] Any release date

Hello all,

The website shows the latest unstable version is 2.0-SNAPSHOT.

I am not sure the date the snapshot was updated but I can see
extensive activity:

https://git1-us-west.apache.org/repos/asf?p=commons-scxml.git

Thanks to the development team. Are there any plans to release it any
time soon ?

Thank you
sebb | 30 Apr 09:44 2016
Picon

[ANNOUNCE] Apache Commons Validator 1.5.1 released

The Apache Commons Team is pleased to announce the release of Apache
Commons Validator 1.5.1

Apache Commons Validator provides the building blocks for both client side
validation and server side data validation. It may be used standalone or
with a framework like Struts.

The main changes are:
* DomainValidator.ArrayType is not public Fixes VALIDATOR-386.
  This now allows the TLD lists to be overriddent using
DomainValidator#updateTLDOverride [1]
* EmailValidator fixes
* Mastercard Series 2 BIN ranges (active from October 2016)
* Updated to the TLD list dated Mon Apr 25 07:07:01 2016 UTC

Details of all the changes in 1.5.1 can be found in the changelog:

http://commons.apache.org/proper/commons-validator/changes-report.html

1.5.1 is fully binary compatible to the last release. No client code
changes are required to migrate from version 1.4.x (or later) to 1.5.1.
The minimum required JDK version for this release is 1.6.

However note that the Javascript code has been dropped, see
https://issues.apache.org/jira/browse/VALIDATOR-371

Source and binary distributions are available for download from the Apache
Commons download site:

http://commons.apache.org/proper/commons-validator/download_validator.cgi
(Continue reading)

Jörg Schaible | 29 Apr 20:36 2016
Picon
Picon
Gravatar

Re: [configuration2]: AbstractConfiguration::getArray

chas <at> honton.org wrote:

> Jorge,
> 
> You could create a different named method for each primitive array
> type.  Would be a pain to use in a generic fashion.

[snip]

I agree with a method returning explicitly an array, but that has been 
nonsense in first place.

As I already pointed out, the existing

 <T> T get(Class<T> cls, String key);

would have been completely enough. See my examples from the last mail.

Cheers,
Jörg
Rainer Hirschmiller | 27 Apr 21:22 2016
Picon

[configuration2]: AbstractConfiguration::getArray

Hi.

I wonder why AbstractConfiguration::getArray(cls, key) returns a single 
object, not an array of objects? Can somebody explain why the caller 
have to make an explicit cast?

e.g.
AbstractConfiguration &configuration = ....;

Object obj = configuration.getArray(String.class, "key);
// expected Object[] obj = configuration.getArray(String.class, "key);

Regards
Rainer
Leonardo K. Shikida | 26 Apr 14:32 2016
Picon
Gravatar

[exec] how to use watchdog / wrong javadoc

Hi

https://commons.apache.org/proper/commons-exec/apidocs/org/apache/commons/exec/ExecuteWatchdog.html

says

 ExecuteWatchdog watchdog = new ExecuteWatchdog(30000);
 Executer exec = new Executer(myloghandler, watchdog);
 exec.setCommandLine(mycmdline);
 int exitvalue = exec.execute();
 if (Execute.isFailure(exitvalue) && watchdog.killedProcess()) {
     // it was killed on purpose by the watchdog
 }

but

"Executer" does not exist

"Executor" does exist but it is an interface

DefaultExecutor implements Executor but does not set a watchdog in the
constructor

[]

Leo
Ahmad, Zeba | 25 Apr 09:45 2016
Picon

[configuration] Monitoring configs

Hi,

I'm looking at providing a platform for users to monitor their configurations either via JMX or some other
means. Some ways I can think of doing this

1)      Let users register their chosen configurations as MBeans.
Here's<https://github.com/Netflix/archaius/blob/master/archaius-core/src/main/java/com/netflix/config/jmx/ConfigJMXManager.java>
a similar approach by Netflix. Here however, platform cannot mandate all configurations to get surfaced
for monitoring.

2)      Read all config files present for the given application in config directory, use Apache Modeler or some
other to dynamically generate bean descriptors and JMX MBeans for monitoring. But here I'm duplicating
the reading of the configs and the memory structures.

3)      Have instrumentation within apache-commons-config  for such monitoring by JMX or any other means.

Reg. #3, is there any recommendation on how users can efficiently monitor/view/modify their
configurations dynamically (without delivering an updated file)?

Regards,
Zeba
Robert Onslow | 22 Apr 12:43 2016
Picon

[CSV] Error: End-of-File, expected line

Hi!

I'm reading CSV encoded in UTF-16:

Reader reader  = new BufferedReader(new InputStreamReader(new
FileInputStream(source), "UTF-16"));
//Ignore 2 bytes of format data
reader.read();
CSVParser parser = format.parse(reader)

The CSV, with record separators 0D0A,  is consumed correctly except I
get thie above error at the end of the parse

The file ends with 0D0A

Does anyone know what the problem may be here, please?

Thanks

Robert
Ashok Panghal | 22 Apr 10:39 2016
Picon

[Imaging][TIFF]- Out Of Memory Heap issue while getting BufferedImage for a High Resolution Tiff image

Hi

Attached [0] is a tiff file of size 18 MB in compressed form which inflates
to ~ 3 GB in uncompressed state.It is a high resolution image with width >
18000 px and height > 47000 px, so while using TiffImageParser it results
into outofmemory error when it tries to allocate space for pixel raster
data in a two-dimensional array in memory in ImageBuilder.java [1].
Can someone points me to an approach or further optimization to avoid heap
issues while dealing with high res tiff images. Heap issue not seen if Heap
size increased to 8 GB or so but that's not very scalable solution for
other more high res images we have almost 5 times bigger than this sample
image.

-Ashok
[0]
https://www.dropbox.com/s/xgey5orhkr2ax6q/wpf150903A.TIF?oref=e&n=301327099
[1]
https://github.com/apache/commons-imaging/blob/trunk/src/main/java/org/apache/commons/imaging/common/ImageBuilder.java#L78

Gmane