List files in a directory (Java)

import java.io.File;
import java.util.Arrays;

public class ReadFile {
	public static void main(String[] args)
	  {
	    // create a file that is really a directory
	    File aDirectory = new File("C:/OGSAN/N42/1000/2000");

	    // get a listing of all files in the directory
	    String[] filesInDir = aDirectory.list();

	    // sort the list of files (optional)
	    // Arrays.sort(filesInDir);

	    // have everything i need, just print it now
	    for ( int i=0; i<filesInDir.length; i++ )
	    {
	      System.out.println( "file: " + filesInDir[i] );
	    }
	  }
}

OUTPUT:
file: 0401.txt
file: 0402.txt
file: 0501.txt
file: 0502.txt

199 thoughts on “List files in a directory (Java)

  1. Pingback: Buy viagra

  2. Pingback: viagra cialis

  3. Pingback: cialis dosage 40 mg

  4. Pingback: cialis dosage 40 mg

  5. Pingback: Canadian viagra 50mg

  6. Pingback: Buy viagra on internet

  7. Pingback: cialis india

  8. Pingback: cialis pills

  9. Pingback: cialis canada

  10. Pingback: is cialis generic

  11. Pingback: canadian pharmacy cialis

  12. Pingback: online pharmacy viagra

  13. Pingback: viagra generic

  14. Pingback: online pharmacy viagra

  15. Pingback: best erectile dysfunction pills

  16. Pingback: impotence pills

  17. Pingback: canadian online pharmacy

  18. Pingback: online pharmacy

  19. Pingback: Buy cialis online

  20. Pingback: Get cialis

  21. Pingback: generic vardenafil

  22. Pingback: vardenafil usa

  23. Pingback: generic vardenafil online

  24. Pingback: slot machine games

  25. Pingback: online casino with free signup bonus real money usa

  26. Pingback: viagra for sale

  27. Pingback: online casino games for real money

  28. Pingback: play for real online casino games

  29. Pingback: cialis professional

  30. Pingback: cash payday

  31. Pingback: loans online

  32. Pingback: loans for bad credit

  33. Pingback: viagra prescription

  34. Pingback: generic cialis

  35. Pingback: cialis 20

  36. Pingback: generic cialis

  37. Pingback: 20 cialis

  38. Pingback: generic for cialis

  39. Pingback: 20 cialis

  40. Pingback: viagra online canada

  41. Pingback: real money casino

  42. Pingback: casinos online

  43. Pingback: free casino games

  44. Pingback: chumba casino

  45. Pingback: generic sildenafil

  46. Pingback: viagra without a doctor prescription

  47. Pingback: sildenafil dosage

  48. Pingback: cialis pill

  49. Pingback: canadian pharmacy cialis

  50. Pingback: cialis coupon

  51. Pingback: buy cialis online reddit

  52. Pingback: real money online casinos usa

  53. Pingback: online casino gambling

  54. Pingback: Levitra vs viagra

  55. Pingback: viagra pills online

  56. Pingback: buy viagra from canada online

  57. Pingback: 007 viagra

  58. Pingback: cheap viagra australia

  59. Pingback: online pharmacy canada generic viagra

  60. Pingback: sildenafil 50 coupon

  61. Pingback: buy levitra 20mg

  62. Pingback: buy viagra paypal online

  63. Pingback: sildenafil uk 100mg

  64. Pingback: How to get some viagra

  65. Pingback: Viagra 100mg england

  66. Pingback: cialis online

  67. Pingback: United healthcare viagra

  68. Pingback: urgent custom essays

  69. Pingback: dissertation paper

  70. Pingback: order cialis no prescription

  71. Pingback: academic essay writing help

  72. Pingback: usa essay writing services

  73. Pingback: thesis writing tips

  74. Pingback: writing a thesis paragraph

  75. Pingback: pay someone to write my research paper

  76. Pingback: i need someone to write my paper

  77. Pingback: viagra mail order

  78. Pingback: cialis for daily use

  79. Pingback: how long does cialis take to work

  80. Pingback: order cialis in australia

  81. Pingback: over the counter viagra substitute walgreens

  82. Pingback: canadian drug pharmacy

  83. Pingback: drugs from canada online

  84. Pingback: northwest pharmacy canada

  85. Pingback: cialis no consultation

  86. Pingback: domestic cialis online cheap

  87. Pingback: does cialis really work

  88. Pingback: original cialis low price

  89. Pingback: generic cialis 40 mg

  90. Pingback: cialis 20 mg cost

  91. Pingback: buy cialis 36 hour online

  92. Pingback: buy cialis online in canada

  93. Pingback: original cialis low price

  94. Pingback: buy cialis insurance

  95. Pingback: buy cialis tadalafil tablets

  96. Pingback: writing thesis

  97. Pingback: choosing a dissertation topic

  98. Pingback: thesis writing

  99. Pingback: custom essays usa

  100. Pingback: best website for essays

  101. Pingback: 10 mg cialis for sale

  102. Pingback: prescription drugs from canada online

  103. Pingback: cialis coupon voucher

  104. Pingback: long term effects of cialis use

  105. Pingback: review canadian pharmacy online

  106. Pingback: cialis on sale

  107. Pingback: history of prescription drugs

  108. Pingback: viagra government funding snopes

  109. Pingback: women taking cialis

  110. Pingback: pharmacy evaluating exam canada

  111. Pingback: amlodipine indications

  112. Pingback: atorvastatin recall 2019

  113. Pingback: fluoxetine overdose death

  114. Pingback: quetiapine contraindications

  115. Pingback: lexapro versus zoloft

  116. Pingback: help paying for duloxetine

  117. Pingback: viagra for sale online

  118. Pingback: viagra online pharmacy

  119. Pingback: viagra professional

  120. Pingback: viagra prescription online

  121. Pingback: cheap viagra

  122. Pingback: cialis mg

  123. Pingback: where can you buy cialis

  124. Pingback: lexapro hot flashes

  125. Pingback: cialis india

  126. Pingback: buy cialis tadalafil

  127. Pingback: womens viagra

  128. Pingback: viagra buy online

  129. Pingback: canada viagra

  130. Pingback: cialis tadalafil buy online

  131. Pingback: cheapest viagra

  132. Pingback: buy brand viagra online

  133. Pingback: sildenafil 87 50 mg

  134. Pingback: amoxicillin and potassium tablet

  135. Pingback: tadalafil vs sildenafil

  136. Pingback: sildenafil citrate 100mg

  137. Pingback: buy viagra online cheap

  138. Pingback: buy brand name propecia

  139. Pingback: cialis erectile dysfunction

  140. Pingback: generic prednisone

  141. Pingback: free viagra

  142. Pingback: tadalafil 30mg capsules

  143. Pingback: ivermectina 6mg

  144. Pingback: pfizer viagra online

  145. Pingback: viagra tablets

  146. Pingback: cialis over the counter in usa

  147. Pingback: ivermectin for human scabies

  148. Pingback: india pharmacy viagra

  149. Pingback: stromectol birth control

  150. Pingback: where can i purchase cialis

  151. Pingback: ivermectin for sale for humans

  152. Pingback: zithramax usage

  153. Pingback: ivermectin for goat lice

  154. Pingback: can you buy female viagra over the counter

  155. Pingback: ventolin for copd

  156. Pingback: organic viagra pills

  157. Pingback: safe viagra online sites

  158. Pingback: teen female viagra car crash gear

  159. Pingback: peptides tadalafil

  160. Pingback: cialis precio mexico

  161. Pingback: zithromax cost

  162. Pingback: buy cheap viagra and cialis

  163. Pingback: generic sildenafil

  164. Pingback: buy sildenafil

  165. Pingback: is lisinopril a good drug

  166. Pingback: female viagra pills

  167. Pingback: dapoxetine us approval

  168. Pingback: over the counter chlamydia treatment cvs

  169. Pingback: otc viagra

  170. Pingback: azithromycin zithromax over the counter

  171. Pingback: viagra dosages

  172. Pingback: order viagra no prescription

  173. Pingback: viagra no prior prescription

  174. Pingback: viagra cvs

  175. Pingback: viagra homme

  176. Pingback: viagra vs cialis

  177. Pingback: amoxicillin 500 mg

  178. Pingback: herb viagra

  179. Pingback: lasix tablet

  180. Pingback: gabapentin 3600 mg

  181. Pingback: plaquenil eye

  182. Pingback: prednisone 20mg pills

  183. Pingback: female viagra pill

  184. Pingback: dapoxetine uk cost

  185. Pingback: provigil india buy

  186. Pingback: buy stromectol uk

  187. Pingback: buy albuterol

  188. Pingback: azithromycin 1000mg

  189. Pingback: strongest viagra pill

  190. Pingback: lasix tablets buy

  191. Pingback: online viagra

  192. Pingback: quineprox 0.5

  193. Pingback: prednisone 54

  194. Pingback: priligy online india

  195. Pingback: what is viagra

  196. Pingback: viagra kaufen

  197. Pingback: viagra pills for men

  198. Pingback: generic for viagra

  199. Pingback: viagra generic

發表迴響