44import pl .smsapi .api .action .AbstractSendAction ;
55import pl .smsapi .api .response .StatusResponse ;
66
7- import java .io .File ;
8- import java .io .FileInputStream ;
9- import java .io .FileNotFoundException ;
10- import java .io .InputStream ;
7+ import java .io .*;
8+ import java .nio .file .Files ;
119
1210public class VMSSend extends AbstractSendAction <VMSSend , StatusResponse > {
1311
@@ -24,12 +22,49 @@ public String toString() {
2422 }
2523 }
2624
25+ /**
26+ * @deprecated use {@link VMSSend(String, String)} or {@link VMSSend(String[], String)} or {@link VMSSend(String, File)}
27+ * or {@link VMSSend(String[], File)} instead
28+ */
2729 public VMSSend () {
2830 setJson (true );
2931 }
3032
33+ public VMSSend (String to , String tts ) {
34+ setJson (true );
35+ setTo (to );
36+ params .put ("tts" , tts );
37+ }
38+
39+ public VMSSend (String [] to , String tts ) {
40+ setJson (true );
41+ setTo (to );
42+ params .put ("tts" , tts );
43+ }
44+
45+ public VMSSend (String to , File file ) throws IOException {
46+ setJson (true );
47+ setTo (to );
48+ files .put ("file" , Files .newInputStream (file .toPath ()));
49+ }
50+
51+ public VMSSend (String [] to , File file ) throws IOException {
52+ setJson (true );
53+ setTo (to );
54+ files .put ("file" , Files .newInputStream (file .toPath ()));
55+ }
56+
57+ public VMSSend (String [] to , InputStream file ) {
58+ setJson (true );
59+ setTo (to );
60+ files .put ("file" , file );
61+ }
62+
3163 /**
3264 * Set local audio file.
65+ *
66+ * @deprecated use {@link VMSSend(String, File)} or {@link VMSSend(String[], File)} instead
67+ *
3368 */
3469 public VMSSend setFile (File file ) throws FileNotFoundException {
3570 files .put ("file" , new FileInputStream (file ));
@@ -38,6 +73,8 @@ public VMSSend setFile(File file) throws FileNotFoundException {
3873
3974 /**
4075 * Set local audio filename.
76+ *
77+ * @deprecated use {@link VMSSend(String, File)} or {@link VMSSend(String[], File)} instead
4178 */
4279 public VMSSend setFile (String pathFile ) throws FileNotFoundException {
4380 files .put ("file" , new FileInputStream (pathFile ));
@@ -46,6 +83,8 @@ public VMSSend setFile(String pathFile) throws FileNotFoundException {
4683
4784 /**
4885 * Set local audio stream.
86+ *
87+ * @deprecated use {@link VMSSend(String[], InputStream)} instead
4988 */
5089 public VMSSend setFile (InputStream inputStream ) {
5190 files .put ("file" , inputStream );
@@ -54,6 +93,8 @@ public VMSSend setFile(InputStream inputStream) {
5493
5594 /**
5695 * Set text to voice synthesizer.
96+ *
97+ * @deprecated use {@link VMSSend(String, String)} or {@link VMSSend(String[], String)} instead
5798 */
5899 public VMSSend setTts (String tts ) {
59100 params .put ("tts" , tts );
0 commit comments