comparison src/main/java/org/monetdb/jdbc/MonetConnection.java @ 626:06d69b82d409

Resolve javadoc error and warnings : [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/jdbc/MonetDriver.java:35: error: tag not supported in the generated HTML version: tt [javadoc] * <tt>jdbc:monetdb://&lt;host&gt;[:&lt;port&gt;]/&lt;database&gt;</tt> [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/mcl/io/LineType.java:58: warning: no @param for line [javadoc] public static final LineType classify(String line) { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/mcl/io/LineType.java:58: warning: no @return [javadoc] public static final LineType classify(String line) { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/mcl/io/LineType.java:72: warning: no @param for line [javadoc] public static final LineType classify(byte[] line) { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/mcl/io/LineType.java:72: warning: no @return [javadoc] public static final LineType classify(byte[] line) { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/jdbc/MonetConnection.java:1700: warning: no @return [javadoc] public UploadHandler getUploadHandler() { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/jdbc/MonetConnection.java:1716: warning: no @return [javadoc] public DownloadHandler getDownloadHandler() { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/jdbc/MonetConnection.java:3511: warning: no @param for errorMessage [javadoc] public void sendError(final String errorMessage) throws IOException { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/jdbc/MonetConnection.java:3511: warning: no @throws for java.io.IOException [javadoc] public void sendError(final String errorMessage) throws IOException { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/jdbc/MonetConnection.java:3525: warning: no @return [javadoc] public InputStream getStream() throws IOException { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/jdbc/MonetConnection.java:3525: warning: no @throws for java.io.IOException [javadoc] public InputStream getStream() throws IOException { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/jdbc/MonetConnection.java:3539: warning: no @param for stream [javadoc] public void downloadTo(final OutputStream stream) throws IOException { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/jdbc/MonetConnection.java:3539: warning: no @throws for java.io.IOException [javadoc] public void downloadTo(final OutputStream stream) throws IOException { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/jdbc/MonetConnection.java:3553: warning: no description for @param [javadoc] * @param writer [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/jdbc/MonetConnection.java:3555: warning: no @throws for java.io.IOException [javadoc] public void downloadTo(final Writer writer) throws IOException { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/jdbc/MonetConnection.java:3336: warning: no @throws for java.io.IOException [javadoc] void handleDownload(Download handle, String name, boolean textMode) throws IOException; [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/jdbc/MonetConnection.java:3367: warning: no @throws for java.io.IOException [javadoc] public void sendError(final String errorMessage) throws IOException { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/jdbc/MonetConnection.java:3378: warning: no @param for chunkSize [javadoc] public void setChunkSize(final int chunkSize) { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/jdbc/MonetConnection.java:3387: warning: no @return [javadoc] public PrintStream getStream() throws IOException { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/jdbc/MonetConnection.java:3387: warning: no @throws for java.io.IOException [javadoc] public PrintStream getStream() throws IOException { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/jdbc/MonetConnection.java:3423: warning: no @param for inputStream [javadoc] public void uploadFrom(final InputStream inputStream) throws IOException { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/jdbc/MonetConnection.java:3423: warning: no @throws for java.io.IOException [javadoc] public void uploadFrom(final InputStream inputStream) throws IOException { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/jdbc/MonetConnection.java:3441: warning: no @throws for java.io.IOException [javadoc] public void uploadFrom(final BufferedReader reader, final long linesToSkip) throws IOException { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/jdbc/MonetConnection.java:3456: warning: no @throws for java.io.IOException [javadoc] public void uploadFrom(final Reader reader) throws IOException { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/jdbc/MonetConnection.java:3308: warning: no @throws for java.io.IOException [javadoc] void handleUpload(Upload handle, String name, boolean textMode, long linesToSkip) throws IOException; [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/jdbc/MonetDatabaseMetaData.java:114: warning: @return has already been specified [javadoc] * @return negative of nullsAreSortedHigh() [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/mcl/net/MapiSocket.java:732: warning: no @param for b [javadoc] public boolean setInsertFakePrompts(boolean b) { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/mcl/net/MapiSocket.java:732: warning: no @return [javadoc] public boolean setInsertFakePrompts(boolean b) { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/mcl/net/MapiSocket.java:1184: warning: no @return [javadoc] public UploadStream uploadStream(int chunkSize) { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/mcl/net/MapiSocket.java:1193: warning: no @return [javadoc] public UploadStream uploadStream() { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/mcl/net/MapiSocket.java:1203: warning: no @return [javadoc] public DownloadStream downloadStream(boolean prependCr) { [javadoc] ^ [javadoc] /home/dinther/dev/javadev/src/main/java/org/monetdb/mcl/net/MapiSocket.java:1259: warning: no @param for cancellationCallback [javadoc] public void setCancellationCallback(final Runnable cancellationCallback) { [javadoc] ^ [javadoc] Building index for all the packages and classes... [javadoc] Building index for all classes... [javadoc] Building index for all classes... [javadoc] Generating /home/dinther/dev/javadev/doc/help-doc.html... [javadoc] 1 error [javadoc] 31 warnings
author Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
date Thu, 20 Jan 2022 19:07:45 +0100 (2022-01-20)
parents 1c3cdf0667d7
children 849f99124e32
comparison
equal deleted inserted replaced
625:b32999570f4d 626:06d69b82d409
1693 public void setUploadHandler(final UploadHandler uploadHandler) { 1693 public void setUploadHandler(final UploadHandler uploadHandler) {
1694 this.uploadHandler = uploadHandler; 1694 this.uploadHandler = uploadHandler;
1695 } 1695 }
1696 1696
1697 /** 1697 /**
1698 * Returns the currently registerered {@link UploadHandler}, or null 1698 * @return the currently registerered {@link UploadHandler}, or null
1699 */ 1699 */
1700 public UploadHandler getUploadHandler() { 1700 public UploadHandler getUploadHandler() {
1701 return uploadHandler; 1701 return uploadHandler;
1702 } 1702 }
1703 1703
1709 public void setDownloadHandler(final DownloadHandler downloadHandler) { 1709 public void setDownloadHandler(final DownloadHandler downloadHandler) {
1710 this.downloadHandler = downloadHandler; 1710 this.downloadHandler = downloadHandler;
1711 } 1711 }
1712 1712
1713 /** 1713 /**
1714 * Returns the currently registerered {@link DownloadHandler} handler, or null 1714 * @return the currently registerered {@link DownloadHandler} handler, or null
1715 */ 1715 */
1716 public DownloadHandler getDownloadHandler() { 1716 public DownloadHandler getDownloadHandler() {
1717 return downloadHandler; 1717 return downloadHandler;
1718 } 1718 }
1719 1719
3302 * @param textMode Whether to open the file as text or binary data. 3302 * @param textMode Whether to open the file as text or binary data.
3303 * @param linesToSkip In text mode, number of initial lines to skip. 3303 * @param linesToSkip In text mode, number of initial lines to skip.
3304 * 0 means upload everything, 1 means skip the first line, etc. 3304 * 0 means upload everything, 1 means skip the first line, etc.
3305 * Note: this is different from the OFFSET option of the COPY INTO, 3305 * Note: this is different from the OFFSET option of the COPY INTO,
3306 * where both 0 and 1 mean 'upload everything' 3306 * where both 0 and 1 mean 'upload everything'
3307 * @throws IOException when I/O problem occurs
3307 */ 3308 */
3308 void handleUpload(Upload handle, String name, boolean textMode, long linesToSkip) throws IOException; 3309 void handleUpload(Upload handle, String name, boolean textMode, long linesToSkip) throws IOException;
3309 3310
3310 /** 3311 /**
3311 * Called when the upload is cancelled halfway by the server. 3312 * Called when the upload is cancelled halfway by the server.
3330 * 3331 *
3331 * @param handle Handle to communicate with the server 3332 * @param handle Handle to communicate with the server
3332 * @param name Name of the file the server would like to write. Make sure 3333 * @param name Name of the file the server would like to write. Make sure
3333 * to validate this before writing to the file system 3334 * to validate this before writing to the file system
3334 * @param textMode Whether this is text or binary data. 3335 * @param textMode Whether this is text or binary data.
3336 * @throws IOException when I/O problem occurs
3335 */ 3337 */
3336 void handleDownload(Download handle, String name, boolean textMode) throws IOException; 3338 void handleDownload(Download handle, String name, boolean textMode) throws IOException;
3337 } 3339 }
3338 3340
3339 /** 3341 /**
3360 * with this error message. The connection will remain usable. 3362 * with this error message. The connection will remain usable.
3361 * 3363 *
3362 * This method can only be sent if no data has been sent to the server 3364 * This method can only be sent if no data has been sent to the server
3363 * yet. After data has been sent, you can still throw an 3365 * yet. After data has been sent, you can still throw an
3364 * {@link IOException} but this will terminate the connection. 3366 * {@link IOException} but this will terminate the connection.
3365 * @param errorMessage error message to send 3367 *
3368 * @param errorMessage the error message to send
3369 * @throws IOException when error message is null
3366 */ 3370 */
3367 public void sendError(final String errorMessage) throws IOException { 3371 public void sendError(final String errorMessage) throws IOException {
3368 if (error != null) { 3372 if (error != null) {
3369 throw new IOException("another error has already been sent: " + error); 3373 throw new IOException("another error has already been sent: " + error);
3370 } 3374 }
3372 } 3376 }
3373 3377
3374 /** 3378 /**
3375 * After every {@code chunkSize} bytes, the server gets the opportunity to 3379 * After every {@code chunkSize} bytes, the server gets the opportunity to
3376 * terminate the upload. 3380 * terminate the upload.
3381 *
3382 * @param chunkSize size of chunk
3377 */ 3383 */
3378 public void setChunkSize(final int chunkSize) { 3384 public void setChunkSize(final int chunkSize) {
3379 this.customChunkSize = chunkSize; 3385 this.customChunkSize = chunkSize;
3380 } 3386 }
3381 3387
3382 /** 3388 /**
3383 * Get a {@link PrintStream} to write data to. 3389 * Get a {@link PrintStream} to write data to.
3384 * 3390 *
3385 * For text mode uploads, the data MUST be validly UTF-8 encoded. 3391 * For text mode uploads, the data MUST be validly UTF-8 encoded.
3392 *
3393 * @return PrintStream a PrintStream
3394 * @throws IOException when error message is null or I/O problem occurs
3386 */ 3395 */
3387 public PrintStream getStream() throws IOException { 3396 public PrintStream getStream() throws IOException {
3388 if (error != null) { 3397 if (error != null) {
3389 throw new IOException("Cannot send data after an error has been sent"); 3398 throw new IOException("Cannot send data after an error has been sent");
3390 } 3399 }
3417 3426
3418 /** 3427 /**
3419 * Read from the given input stream and write it to the server. 3428 * Read from the given input stream and write it to the server.
3420 * 3429 *
3421 * For text mode uploads, the data MUST be validly UTF-8 encoded. 3430 * For text mode uploads, the data MUST be validly UTF-8 encoded.
3431 *
3432 * @param inputStream stream to read from
3433 * @throws IOException when I/O problem occurs
3422 */ 3434 */
3423 public void uploadFrom(final InputStream inputStream) throws IOException { 3435 public void uploadFrom(final InputStream inputStream) throws IOException {
3424 final OutputStream s = getStream(); 3436 final OutputStream s = getStream();
3425 final byte[] buffer = new byte[64 * 1024]; 3437 final byte[] buffer = new byte[64 * 1024];
3426 while (true) { 3438 while (true) {
3432 } 3444 }
3433 } 3445 }
3434 3446
3435 /** 3447 /**
3436 * Read data from the given buffered reader and send it to the server 3448 * Read data from the given buffered reader and send it to the server
3437 * @param reader reader to read from 3449 *
3450 * @param reader buffered reader to read from
3438 * @param linesToSkip start uploading at line {@code offset}. Value 0 and 1 3451 * @param linesToSkip start uploading at line {@code offset}. Value 0 and 1
3439 * both mean upload the whole file, value 2 means skip the first line, etc. 3452 * both mean upload the whole file, value 2 means skip the first line, etc.
3453 * @throws IOException when I/O problem occurs
3440 */ 3454 */
3441 public void uploadFrom(final BufferedReader reader, final long linesToSkip) throws IOException { 3455 public void uploadFrom(final BufferedReader reader, final long linesToSkip) throws IOException {
3442 for (int i = 0; i < linesToSkip; i++) { 3456 for (int i = 0; i < linesToSkip; i++) {
3443 String line = reader.readLine(); 3457 String line = reader.readLine();
3444 if (line == null) { 3458 if (line == null) {
3449 uploadFrom(reader); 3463 uploadFrom(reader);
3450 } 3464 }
3451 3465
3452 /** 3466 /**
3453 * Read data from the given buffered reader and send it to the server 3467 * Read data from the given buffered reader and send it to the server
3468 *
3454 * @param reader reader to read from 3469 * @param reader reader to read from
3470 * @throws IOException when ...
3455 */ 3471 */
3456 public void uploadFrom(final Reader reader) throws IOException { 3472 public void uploadFrom(final Reader reader) throws IOException {
3457 final OutputStream s = getStream(); 3473 final OutputStream s = getStream();
3458 final OutputStreamWriter writer = new OutputStreamWriter(s, StandardCharsets.UTF_8); 3474 final OutputStreamWriter writer = new OutputStreamWriter(s, StandardCharsets.UTF_8);
3459 final char[] buffer = new char[64 * 1024]; 3475 final char[] buffer = new char[64 * 1024];
3505 * yet. After data has been received, you can still throw an 3521 * yet. After data has been received, you can still throw an
3506 * {@link IOException} but this will terminate the connection. 3522 * {@link IOException} but this will terminate the connection.
3507 * 3523 *
3508 * Note: as of MonetDB version Jul2021 the server always terminates the connection 3524 * Note: as of MonetDB version Jul2021 the server always terminates the connection
3509 * when this error is used. This will probably change in the future. 3525 * when this error is used. This will probably change in the future.
3526 *
3527 * @param errorMessage the error message to send
3528 * @throws IOException when error message is null
3510 */ 3529 */
3511 public void sendError(final String errorMessage) throws IOException { 3530 public void sendError(final String errorMessage) throws IOException {
3512 if (error != null) { 3531 if (error != null) {
3513 throw new IOException("another error has already been sent: " + error); 3532 throw new IOException("another error has already been sent: " + error);
3514 } 3533 }
3519 * Get an {@link InputStream} to read data from. 3538 * Get an {@link InputStream} to read data from.
3520 * 3539 *
3521 * Textual data is UTF-8 encoded. If the download is in text mode, line endings 3540 * Textual data is UTF-8 encoded. If the download is in text mode, line endings
3522 * are converted according to {@link java.lang.System#lineSeparator()}. 3541 * are converted according to {@link java.lang.System#lineSeparator()}.
3523 * This can be overridden with {@link Download#setLineSeparator(String)}. 3542 * This can be overridden with {@link Download#setLineSeparator(String)}.
3543 *
3544 * @return InputStream the stream to read from
3545 * @throws IOException when error message exist or I/O problem occurs
3524 */ 3546 */
3525 public InputStream getStream() throws IOException { 3547 public InputStream getStream() throws IOException {
3526 if (error != null) { 3548 if (error != null) {
3527 throw new IOException("cannot receive data after error has been sent"); 3549 throw new IOException("cannot receive data after error has been sent");
3528 } 3550 }
3533 return stream; 3555 return stream;
3534 } 3556 }
3535 3557
3536 /** 3558 /**
3537 * Write the data from the server to the given {@link OutputStream}. 3559 * Write the data from the server to the given {@link OutputStream}.
3560 *
3561 * @param stream the OutputStream to write to
3562 * @throws IOException when cannot read from InputStream or write to OutputStream
3538 */ 3563 */
3539 public void downloadTo(final OutputStream stream) throws IOException { 3564 public void downloadTo(final OutputStream stream) throws IOException {
3540 final InputStream s = getStream(); 3565 final InputStream s = getStream();
3541 final byte[] buffer = new byte[65536]; 3566 final byte[] buffer = new byte[65536];
3542 while (true) { 3567 while (true) {
3548 } 3573 }
3549 } 3574 }
3550 3575
3551 /** 3576 /**
3552 * Write the textual data from the server to the given {@link Writer} 3577 * Write the textual data from the server to the given {@link Writer}
3553 * @param writer 3578 *
3579 * @param writer to write to
3580 * @throws IOException when cannot read from InputStreamReader or write to Writer
3554 */ 3581 */
3555 public void downloadTo(final Writer writer) throws IOException { 3582 public void downloadTo(final Writer writer) throws IOException {
3556 final InputStream s = getStream(); 3583 final InputStream s = getStream();
3557 final InputStreamReader r = new InputStreamReader(s, StandardCharsets.UTF_8); 3584 final InputStreamReader r = new InputStreamReader(s, StandardCharsets.UTF_8);
3558 final char[] buffer = new char[65536]; 3585 final char[] buffer = new char[65536];
3564 writer.write(buffer, 0, nread); 3591 writer.write(buffer, 0, nread);
3565 } 3592 }
3566 } 3593 }
3567 3594
3568 /** 3595 /**
3569 * @return true if data has been received or an error has been sent. 3596 * @return true if data has been received or an error has been sent.
3570 */ 3597 */
3571 public boolean hasBeenUsed() { 3598 public boolean hasBeenUsed() {
3572 return stream != null || error != null; 3599 return stream != null || error != null;
3573 } 3600 }
3574 3601
3593 } 3620 }
3594 } 3621 }
3595 3622
3596 /** 3623 /**
3597 * Set the line endings used in the stream returned by {@link Download#getStream()} 3624 * Set the line endings used in the stream returned by {@link Download#getStream()}
3625 *
3598 * @param sep separator to use 3626 * @param sep separator to use
3599 * @throws IllegalArgumentException if sep is neither "\n" nor "\r\n" 3627 * @throws IllegalArgumentException if sep is neither "\n" nor "\r\n"
3600 */ 3628 */
3601 public void setLineSeparator(final String sep) { 3629 public void setLineSeparator(final String sep) {
3602 if ("\n".equals(sep)) { 3630 if ("\n".equals(sep)) {