From 97326a70ef2af4d5035e88e46928e5f13ff49aec Mon Sep 17 00:00:00 2001 From: Ivan Morell Date: Mon, 19 Sep 2022 17:25:25 +0200 Subject: [PATCH] Test Fichero --- .classpath | 10 +++++ .project | 17 +++++++ .settings/org.eclipse.core.resources.prefs | 2 + .settings/org.eclipse.jdt.core.prefs | 14 ++++++ bin/Package/HolaFichero.class | Bin 0 -> 1858 bytes bin/module-info.class | Bin 0 -> 150 bytes src/Package/HolaFichero.java | 49 +++++++++++++++++++++ src/module-info.java | 9 ++++ 8 files changed, 101 insertions(+) create mode 100644 .classpath create mode 100644 .project create mode 100644 .settings/org.eclipse.core.resources.prefs create mode 100644 .settings/org.eclipse.jdt.core.prefs create mode 100644 bin/Package/HolaFichero.class create mode 100644 bin/module-info.class create mode 100644 src/Package/HolaFichero.java create mode 100644 src/module-info.java diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..57bca72 --- /dev/null +++ b/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..09cf73a --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + HolaFichero + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..8c9943d --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=17 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=17 diff --git a/bin/Package/HolaFichero.class b/bin/Package/HolaFichero.class new file mode 100644 index 0000000000000000000000000000000000000000..86d545b2f7414d0cb3d5b82d1ea374122c62c4d6 GIT binary patch literal 1858 zcmah}T~`}b6x}x&m`NBQ4F$?a>CjdPP!goJ-Ak^@oDPUXt7{UdnCNr$b1n7f* z#3$c;@kJkKm#*ax@WnsmQum!C5EgN{vex9Dd(J&)?|sg_fBgOH?*Qf@bwmVuHtgcJ z_JPbSdnJ3xDIQAS)1e6@UfRcYrewPZnf2Y5vKR>H1*a0ovMnHT0_}5->jVn|(bUA2 zfR^+2WE@d+n9yMebmtvcu2svs(tm32mZU&3?-lLRmhC&ru5W6=p;Hm)&9?xOW!kds zxB`8t7x@c7g}`^*gY3js9AsePI(h|StIjz-LdwO^j{zMwE>S7GQVdKCVu--KDp~c` z5<6aIgINRSmUcNC$4%VQF~a;|-OFwh7Dg$^kvdT#J}s3CMX>z?lIdvy*1%f=H*-wx z?s-<(v3RyDeQUp_xs^_*Rn2jgIz?2eR(uUivZ_}}yLOpk_v4<4X`}@@4rH+5dq>g_ zUI~n~I(#*sff<2;#gbL2_0>}6?Z7$qELoYg6rB4e-cfMcLZ)%Nhxc_nxGZVd3=<#V zLk>mp(DoluRV}qLku$&!c5FLjd{VKd7c2wwY!nBhda6vefGs1VdI;-;K7mNZQ}c4A z!~JT1zj!13IQj!&9;xUzokF|Z;q(r8Gd4brt5c-avh zp9+|b0a$WM(!i=fIybwsS&@EaXXV&-cOHAiYFWBLW#=lEbZ{EP@dWGYR;1MGGZUYq zK&j*@WhZ+M>vQGUG_j=|okb2wAlKwct>6~|gLQ(Ia&devP_p;N{z*+?fv%cj99DId z;wPFAh0+@MQec?7;TSftt~G_64SY>qGKXGSW@x4}O(`~A=TtE=z(=6}DyY!UF78(u zC=f4rRlg_|7D8!yVbV%cjPmwI`4*7^+R)Bb8`pe1_>IxZ@L#Ci$=8Vg%tZtyzwP0s zhEA@{S^&DxO)G{3u5m{lUS@PeMZ7_B?ich8oniPQM^{)l1`Tm^FpJ97SBuAO+@Yn_ zK`C&2U+P)^WQ<1dqr}5(VtX!;pJ(di-7}0OC*ELcO<9>UygeN~!@EO2AfYy9xiOUe z5uM7IqcNNv{E11TA)N)S`T022Mr>PLLYCq{QOX1_lO3pdApv#J~(>Ffp(& TumWi@1~#xTBLhbRm;oUGd37Du literal 0 HcmV?d00001 diff --git a/src/Package/HolaFichero.java b/src/Package/HolaFichero.java new file mode 100644 index 0000000..9675905 --- /dev/null +++ b/src/Package/HolaFichero.java @@ -0,0 +1,49 @@ +package Package; +import java.io.File; +import java.io.IOException; +public class HolaFichero { + + static char Sistema; + + public static void main(String args[]) { + char Sistema=MiSistema(); + System.out.println(Sistema); + + } + + static char MiSistema() { + char Sis='?'; + char Windows='W'; + char Linux='L'; + System.out.println("Creando mi primer fichero ..."); + String so = System.getProperty("os.name"); + System.out.print("El sistema operativo es: "); + if (so.charAt(0)==Windows) { + System.out.print("Windows -> "); + Sis=Windows; + } + else { + System.out.print("Linux -> "); + Sis=Linux; + } + return Sis; + } + + public void CreoFicheroWindows() throws IOException { + System.out.println("Creando fichero en Windows ..."); + File fwindows = new File("C:\\Users\\Ivan\\Documents\\CreoFicheroWindows.txt"); + if (!fwindows.exists()) { + fwindows.createNewFile(); + } + System.out.println("Fichero creado en Windows."); + } + + public void CreoFicheroLinux() throws IOException { + System.out.println("Creando fichero en Linux ..."); + File funix = new File("/home/..../CreoFicheroUnix.txt"); + if (!funix.exists()) { + funix.createNewFile(); + } + System.out.println("Fichero creado en Unix."); + } +} diff --git a/src/module-info.java b/src/module-info.java new file mode 100644 index 0000000..1b5ee1d --- /dev/null +++ b/src/module-info.java @@ -0,0 +1,9 @@ +/** + * + */ +/** + * @author Ivan + * + */ +module HolaFichero { +} \ No newline at end of file